Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
d3df963a
Commit
d3df963a
authored
14 years ago
by
Matei Zaharia
Browse files
Options
Downloads
Patches
Plain Diff
Brought in some reorganization of build file from Hive branch
parent
e8df4bbd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
project/build/SparkProject.scala
+54
-50
54 additions, 50 deletions
project/build/SparkProject.scala
with
54 additions
and
50 deletions
project/build/SparkProject.scala
+
54
−
50
View file @
d3df963a
...
@@ -15,58 +15,62 @@ extends ParentProject(info) with IdeaProject
...
@@ -15,58 +15,62 @@ extends ParentProject(info) with IdeaProject
project
(
"examples"
,
"Spark Examples"
,
new
ExamplesProject
(
_
),
core
)
project
(
"examples"
,
"Spark Examples"
,
new
ExamplesProject
(
_
),
core
)
class
CoreProject
(
info
:
ProjectInfo
)
class
CoreProject
(
info
:
ProjectInfo
)
extends
DefaultProject
(
info
)
with
Eclipsify
with
IdeaProject
with
AssemblyBuilder
extends
DefaultProject
(
info
)
with
Eclipsify
with
IdeaProject
with
DepJar
with
XmlTestReport
{
{}
def
testReportDir
=
outputPath
/
"test-report"
// Create an XML test report using ScalaTest's -u option. Unfortunately
// there is currently no way to call this directly from SBT without
// executing a subprocess.
lazy
val
testReport
=
task
{
log
.
info
(
"Creating "
+
testReportDir
+
"..."
)
if
(!
testReportDir
.
exists
)
{
testReportDir
.
asFile
.
mkdirs
()
}
log
.
info
(
"Executing org.scalatest.tools.Runner..."
)
val
command
=
(
"scala -classpath "
+
testClasspath
.
absString
+
" org.scalatest.tools.Runner -o "
+
" -u "
+
testReportDir
.
absolutePath
+
" -p "
+
(
outputPath
/
"test-classes"
).
absolutePath
)
val
process
=
Process
(
command
,
path
(
"."
),
"JAVA_OPTS"
->
"-Xmx500m"
)
process
!
None
}.
dependsOn
(
compile
,
testCompile
).
describedAs
(
"Generate XML test report."
)
def
singleJarExclude
(
base
:
PathFinder
)
=
{
(
base
/
"scala"
**
"*"
)
+++
(
// exclude scala library
(
base
/
"META-INF"
**
"*"
)
---
// generally ignore the hell out of META-INF
(
base
/
"META-INF"
/
"services"
**
"*"
)
---
// include all service providers
(
base
/
"META-INF"
/
"maven"
**
"*"
))
// include all Maven POMs and such
}
def
singleJarTempDir
=
outputPath
/
"single-jar-classes"
def
singleJarOutputPath
=
outputPath
/
(
name
.
toLowerCase
.
replace
(
" "
,
"-"
)
+
"-single-jar-"
+
version
.
toString
+
".jar"
)
// Create a JAR with Spark Core and all its dependencies. We use some methods in
// the AssemblyBuilder plugin, but because this plugin attempts to package Scala
// too, we leave that out using our own exclude filter (singleJarExclude).
lazy
val
singleJar
=
{
packageTask
(
Path
.
lazyPathFinder
(
assemblyPaths
(
singleJarTempDir
,
assemblyClasspath
,
assemblyExtraJars
,
singleJarExclude
)),
singleJarOutputPath
,
packageOptions
)
}.
dependsOn
(
compile
).
describedAs
(
"Build a single JAR with project and its dependencies"
)
}
class
ExamplesProject
(
info
:
ProjectInfo
)
class
ExamplesProject
(
info
:
ProjectInfo
)
extends
DefaultProject
(
info
)
with
Eclipsify
with
IdeaProject
extends
DefaultProject
(
info
)
with
Eclipsify
with
IdeaProject
{
{}
}
// Project mixin for an XML-based ScalaTest report. Unfortunately
// there is currently no way to call this directly from SBT without
// executing a subprocess.
trait
XmlTestReport
extends
BasicScalaProject
{
def
testReportDir
=
outputPath
/
"test-report"
lazy
val
testReport
=
task
{
log
.
info
(
"Creating "
+
testReportDir
+
"..."
)
if
(!
testReportDir
.
exists
)
{
testReportDir
.
asFile
.
mkdirs
()
}
log
.
info
(
"Executing org.scalatest.tools.Runner..."
)
val
command
=
(
"scala -classpath "
+
testClasspath
.
absString
+
" org.scalatest.tools.Runner -o "
+
" -u "
+
testReportDir
.
absolutePath
+
" -p "
+
(
outputPath
/
"test-classes"
).
absolutePath
)
Process
(
command
,
path
(
"."
),
"JAVA_OPTS"
->
"-Xmx500m"
)
!
None
}.
dependsOn
(
compile
,
testCompile
).
describedAs
(
"Generate XML test report."
)
}
// Project mixin for creating a JAR with a project's dependencies. This is based
// on the AssemblyBuilder plugin, but because this plugin attempts to package Scala
// and our project too, we leave that out using our own exclude filter (depJarExclude).
trait
DepJar
extends
AssemblyBuilder
{
def
depJarExclude
(
base
:
PathFinder
)
=
{
(
base
/
"scala"
**
"*"
)
+++
// exclude scala library
(
base
/
"spark"
**
"*"
)
+++
// exclude Spark classes
((
base
/
"META-INF"
**
"*"
)
---
// generally ignore the hell out of META-INF
(
base
/
"META-INF"
/
"services"
**
"*"
)
---
// include all service providers
(
base
/
"META-INF"
/
"maven"
**
"*"
))
// include all Maven POMs and such
}
}
def
depJarTempDir
=
outputPath
/
"dep-classes"
def
depJarOutputPath
=
outputPath
/
(
name
.
toLowerCase
.
replace
(
" "
,
"-"
)
+
"-dep-"
+
version
.
toString
+
".jar"
)
lazy
val
depJar
=
{
packageTask
(
Path
.
lazyPathFinder
(
assemblyPaths
(
depJarTempDir
,
assemblyClasspath
,
assemblyExtraJars
,
depJarExclude
)),
depJarOutputPath
,
packageOptions
)
}.
dependsOn
(
compile
).
describedAs
(
"Bundle project's dependencies into a JAR."
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment