Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude non-required artifacts from the lib folder #24

Merged
merged 2 commits into from
Sep 3, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
project/project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, who added project/project? DOH!

project/target
target
.classpath
.project
.settings/
.idea/
*.iml
*.iws
.DS_Store
log/
target/
.cache
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ object JavaAppPackaging {
// Here we record the classpath as it's added to the mappings separately, so
// we can use its order to generate the bash/bat scripts.
scriptClasspathOrdering := Nil,
// Note: This is sometimes on the classpath via depnedencyClasspath in Runtime.
// Note: This is sometimes on the classpath via dependencyClasspath in Runtime.
// We need to figure out why sometimes the Attributed[File] is corrrectly configured
// and sometimes not.
scriptClasspathOrdering <+= (Keys.packageBin in Compile, Keys.projectID, Keys.artifact in Compile in Keys.packageBin) map { (jar, id, art) =>
jar -> ("lib/" + makeJarName(id.organization,id.name,id.revision, art.name))
},
projectDependencyArtifacts <<= findDependencyProjectArtifacts,
//scriptClasspathOrdering <++= projectDependencyMappings,
projectDependencyArtifacts <<= findProjectDependencyArtifacts,
scriptClasspathOrdering <++= (Keys.dependencyClasspath in Runtime, projectDependencyArtifacts) map universalDepMappings,
scriptClasspathOrdering <<= (scriptClasspathOrdering) map {_.distinct},
mappings in Universal <++= scriptClasspathOrdering,
Expand Down Expand Up @@ -141,7 +140,7 @@ object JavaAppPackaging {
}
}

def findDependencyProjectArtifacts: Initialize[Task[Seq[Attributed[File]]]] =
def findProjectDependencyArtifacts: Initialize[Task[Seq[Attributed[File]]]] =
(sbt.Keys.buildDependencies, sbt.Keys.thisProjectRef, sbt.Keys.state) apply { (build, thisProject, stateTask) =>
val refs = thisProject +: dependencyProjectRefs(build, thisProject)
// Dynamic lookup of dependencies...
Expand All @@ -152,6 +151,11 @@ object JavaAppPackaging {
p <- previous
n <- next
} yield (p ++ n)
.filterNot {
f =>
val name = f.data.getName
name.endsWith(".pom") || name.endsWith("-sources.jar") || name.endsWith("-javadoc.jar")
}
}
allArtifactsTask
}
Expand Down