Skip to content

Commit

Permalink
Bump the jarjar-links version
Browse files Browse the repository at this point in the history
This one understands how to deal with Java 8. It
has approximately a million dependencies.
  • Loading branch information
shs96c committed Feb 18, 2017
1 parent c861fe7 commit 51f108a
Show file tree
Hide file tree
Showing 46 changed files with 191 additions and 74 deletions.
43 changes: 7 additions & 36 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -425,44 +425,15 @@ desc "Calculate dependencies required for testing the automation atoms"
task :calcdeps => "build/javascript/deps.js"

desc "Repack jetty"
task "repack-jetty" => "build/third_party/java/jetty/jetty-repacked.jar"

# Expose the repack task to CrazyFun.
task "//third_party/java/jetty:repacked" => "build/third_party/java/jetty/jetty-repacked.jar"

file "build/third_party/java/jetty/jetty-repacked.jar" => [
"third_party/java/jetty/jetty-continuation-9.2.13.v20150730.jar",
"third_party/java/jetty/jetty-http-9.2.13.v20150730.jar",
"third_party/java/jetty/jetty-io-9.2.13.v20150730.jar",
"third_party/java/jetty/jetty-jmx-9.2.13.v20150730.jar",
"third_party/java/jetty/jetty-security-9.2.13.v20150730.jar",
"third_party/java/jetty/jetty-server-9.2.13.v20150730.jar",
"third_party/java/jetty/jetty-servlet-9.2.13.v20150730.jar",
"third_party/java/jetty/jetty-servlets-9.2.13.v20150730.jar",
"third_party/java/jetty/jetty-util-9.2.13.v20150730.jar"
] do |t|
print "Repacking jetty\n"
root = File.join("build", "third_party", "java", "jetty")
jarjar = File.join("third_party", "java", "jarjar", "jarjar-1.4.jar")
rules = File.join("third_party", "java", "jetty", "jetty-repack-rules")
temp = File.join(root, "temp")

# First, process the files
mkdir_p root
mkdir_p temp

t.prerequisites.each do |pre|
filename = File.basename(pre, ".jar")
out = File.join(root, "#{filename}-repacked.jar")
`java -jar #{jarjar} process #{rules} #{pre} #{out}`
`cd #{temp} && jar xf #{File.join("..", File.basename(out))}`
end
task "repack-jetty" => ["//third_party/java/jetty:bundle-jars"] do

# Now, merge them
`cd #{temp} && jar cvf #{File.join("..", "jetty-repacked.jar")} *`
# For IntelliJ
root = File.join("build", "third_party", "java", "jetty")
mkdir_p root
cp Rake::Task['//third_party/java/jetty:bundle-jars'].out, File.join(root, "jetty-repacked.jar")

# And copy the artifact to third_party so that eclipse users can be made happy
cp "build/third_party/java/jetty/jetty-repacked.jar", "third_party/java/jetty/jetty-repacked.jar"
# And copy the artifact to third_party so that eclipse users can be made happy
cp Rake::Task['//third_party/java/jetty:bundle-jars'].out, "third_party/java/jetty/jetty-repacked.jar"
end


Expand Down
10 changes: 10 additions & 0 deletions third_party/java/annotation/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prebuilt_jar(
name = 'jsr250-api',
maven_coords = 'javax.annotation:jsr250-api:jar:1.0',
binary_jar = 'jsr250-api-1.0.jar',
source_jar = 'jsr250-api-1.0-sources.jar',
visibility = [
'//third_party/java/enterprise:cdi-api'
],
)

Binary file not shown.
Binary file added third_party/java/annotation/jsr250-api-1.0.jar
Binary file not shown.
13 changes: 7 additions & 6 deletions third_party/java/ant/BUCK
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
prebuilt_jar(
name = 'ant',
maven_coords = 'org.apache.ant:ant:jar:1.8.2',
binary_jar = 'ant-1.8.2.jar',
source_jar = 'ant-1.8.2.jar',
maven_coords = 'org.apache.ant:ant:jar:1.9.6',
binary_jar = 'ant-1.9.6.jar',
source_jar = 'ant-1.9.6-sources.jar',
deps = [
':ant-launcher'
],
visibility = [
'//third_party/java/pantsbuild:jarjar',
'//third_party/java/testng:testng'
],
)

prebuilt_jar(
name = 'ant-launcher',
maven_coords = 'org.apache.ant:ant-launcher:jar:1.8.2',
binary_jar = 'ant-launcher-1.8.2.jar',
source_jar = 'ant-launcher-1.8.2.jar',
maven_coords = 'org.apache.ant:ant-launcher:jar:1.9.6',
binary_jar = 'ant-launcher-1.9.6.jar',
source_jar = 'ant-launcher-1.9.6-sources.jar',
)

Binary file added third_party/java/ant/ant-1.9.6-sources.jar
Binary file not shown.
Binary file added third_party/java/ant/ant-1.9.6.jar
Binary file not shown.
Binary file not shown.
Binary file added third_party/java/ant/ant-launcher-1.9.6.jar
Binary file not shown.
33 changes: 33 additions & 0 deletions third_party/java/asm/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
prebuilt_jar(
name = 'asm',
maven_coords = 'org.ow2.asm:asm:jar:5.0.4',
binary_jar = 'asm-5.0.4.jar',
source_jar = 'asm-5.0.4-sources.jar',
visibility = [
'//third_party/java/pantsbuild:jarjar'
],
)

prebuilt_jar(
name = 'asm-commons',
maven_coords = 'org.ow2.asm:asm-commons:jar:5.0.4',
binary_jar = 'asm-commons-5.0.4.jar',
source_jar = 'asm-commons-5.0.4-sources.jar',
deps = [
':asm-tree'
],
visibility = [
'//third_party/java/pantsbuild:jarjar'
],
)

prebuilt_jar(
name = 'asm-tree',
maven_coords = 'org.ow2.asm:asm-tree:jar:5.0.4',
binary_jar = 'asm-tree-5.0.4.jar',
source_jar = 'asm-tree-5.0.4-sources.jar',
deps = [
':asm'
],
)

Binary file added third_party/java/asm/asm-5.0.4-sources.jar
Binary file not shown.
Binary file added third_party/java/asm/asm-5.0.4.jar
Binary file not shown.
Binary file not shown.
Binary file added third_party/java/asm/asm-commons-5.0.4.jar
Binary file not shown.
Binary file added third_party/java/asm/asm-tree-5.0.4-sources.jar
Binary file not shown.
Binary file added third_party/java/asm/asm-tree-5.0.4.jar
Binary file not shown.
14 changes: 14 additions & 0 deletions third_party/java/enterprise/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
prebuilt_jar(
name = 'cdi-api',
maven_coords = 'javax.enterprise:cdi-api:jar:1.0',
binary_jar = 'cdi-api-1.0.jar',
source_jar = 'cdi-api-1.0-sources.jar',
deps = [
'//third_party/java/annotation:jsr250-api',
'//third_party/java/inject:javax.inject'
],
visibility = [
'//third_party/java/sisu:org.eclipse.sisu.plexus'
],
)

Binary file not shown.
Binary file added third_party/java/enterprise/cdi-api-1.0.jar
Binary file not shown.
18 changes: 3 additions & 15 deletions third_party/java/inject/BUCK
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
prebuilt_jar(
name = 'guice',
maven_coords = 'com.google.inject:guice:jar:4.0',
binary_jar = 'guice-4.0.jar',
source_jar = 'guice-4.0-sources.jar',
deps = [
':javax.inject',
'//third_party/java/aopalliance:aopalliance',
'//third_party/java/guava:guava'
],
visibility = [
'//third_party/java/testng:testng'
],
)

prebuilt_jar(
name = 'javax.inject',
maven_coords = 'javax.inject:javax.inject:jar:1',
binary_jar = 'javax.inject-1.jar',
source_jar = 'javax.inject-1-sources.jar',
visibility = [
'//third_party/java/enterprise:cdi-api'
],
)

15 changes: 0 additions & 15 deletions third_party/java/jarjar/BUCK

This file was deleted.

Binary file removed third_party/java/jarjar/jarjar-1.4.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion third_party/java/jetty/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ for i in REPACK:
genrule(
name = name,
out = '%s.jar' % out,
cmd = '$(exe //third_party/java/jarjar:jarjar) process $(location :jarjar-rules) $(location :%s) $OUT' % i
cmd = '$(exe //third_party/java/pantsbuild:jarjar-links) process $(location :jarjar-rules) $(location :%s) $OUT' % i
)

prebuilt_jar(
Expand Down
35 changes: 35 additions & 0 deletions third_party/java/maven/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
prebuilt_jar(
name = 'maven-artifact',
maven_coords = 'org.apache.maven:maven-artifact:jar:3.3.3',
binary_jar = 'maven-artifact-3.3.3.jar',
source_jar = 'maven-artifact-3.3.3-sources.jar',
deps = [
'//third_party/java/plexus:plexus-utils'
],
)

prebuilt_jar(
name = 'maven-model',
maven_coords = 'org.apache.maven:maven-model:jar:3.3.3',
binary_jar = 'maven-model-3.3.3.jar',
source_jar = 'maven-model-3.3.3-sources.jar',
deps = [
'//third_party/java/plexus:plexus-utils'
],
)

prebuilt_jar(
name = 'maven-plugin-api',
maven_coords = 'org.apache.maven:maven-plugin-api:jar:3.3.3',
binary_jar = 'maven-plugin-api-3.3.3.jar',
source_jar = 'maven-plugin-api-3.3.3-sources.jar',
deps = [
':maven-artifact',
':maven-model',
'//third_party/java/sisu:org.eclipse.sisu.plexus'
],
visibility = [
'//third_party/java/pantsbuild:jarjar'
],
)

Binary file not shown.
Binary file added third_party/java/maven/maven-artifact-3.3.3.jar
Binary file not shown.
Binary file not shown.
Binary file added third_party/java/maven/maven-model-3.3.3.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions third_party/java/pantsbuild/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
java_binary(
name = 'jarjar-links',
main_class = 'org.pantsbuild.jarjar.Main',
deps = [
':jarjar',
],
visibility = [
'//third_party/java/jetty:',
],
)

prebuilt_jar(
name = 'jarjar',
maven_coords = 'org.pantsbuild:jarjar:jar:1.6.3',
binary_jar = 'jarjar-1.6.3.jar',
source_jar = 'jarjar-1.6.3-sources.jar',
deps = [
'//third_party/java/ant:ant',
'//third_party/java/asm:asm',
'//third_party/java/asm:asm-commons',
'//third_party/java/maven:maven-plugin-api'
],
)

Binary file not shown.
Binary file added third_party/java/pantsbuild/jarjar-1.6.3.jar
Binary file not shown.
32 changes: 32 additions & 0 deletions third_party/java/plexus/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
prebuilt_jar(
name = 'plexus-classworlds',
maven_coords = 'org.codehaus.plexus:plexus-classworlds:jar:2.5.2',
binary_jar = 'plexus-classworlds-2.5.2.jar',
source_jar = 'plexus-classworlds-2.5.2-sources.jar',
visibility = [
'//third_party/java/sisu:org.eclipse.sisu.plexus'
],
)

prebuilt_jar(
name = 'plexus-component-annotations',
maven_coords = 'org.codehaus.plexus:plexus-component-annotations:jar:1.5.5',
binary_jar = 'plexus-component-annotations-1.5.5.jar',
source_jar = 'plexus-component-annotations-1.5.5-sources.jar',
visibility = [
'//third_party/java/sisu:org.eclipse.sisu.plexus'
],
)

prebuilt_jar(
name = 'plexus-utils',
maven_coords = 'org.codehaus.plexus:plexus-utils:jar:3.0.20',
binary_jar = 'plexus-utils-3.0.20.jar',
source_jar = 'plexus-utils-3.0.20-sources.jar',
visibility = [
'//third_party/java/maven:maven-artifact',
'//third_party/java/maven:maven-model',
'//third_party/java/sisu:org.eclipse.sisu.plexus'
],
)

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added third_party/java/plexus/plexus-utils-3.0.20.jar
Binary file not shown.
25 changes: 25 additions & 0 deletions third_party/java/sisu/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
prebuilt_jar(
name = 'org.eclipse.sisu.inject',
maven_coords = 'org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.0',
binary_jar = 'org.eclipse.sisu.inject-0.3.0.jar',
source_jar = 'org.eclipse.sisu.inject-0.3.0-sources.jar',
)

prebuilt_jar(
name = 'org.eclipse.sisu.plexus',
maven_coords = 'org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.0',
binary_jar = 'org.eclipse.sisu.plexus-0.3.0.jar',
source_jar = 'org.eclipse.sisu.plexus-0.3.0-sources.jar',
deps = [
':org.eclipse.sisu.inject',
'//third_party/java/enterprise:cdi-api',
'//third_party/java/junit:junit',
'//third_party/java/plexus:plexus-classworlds',
'//third_party/java/plexus:plexus-component-annotations',
'//third_party/java/plexus:plexus-utils'
],
visibility = [
'//third_party/java/maven:maven-plugin-api'
],
)

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion third_party/java/testng/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ prebuilt_jar(
'//third_party/java/ant:ant',
'//third_party/java/beanshell:bsh',
'//third_party/java/beust:jcommander',
'//third_party/java/inject:guice',
'//third_party/java/junit:junit',
'//third_party/java/yaml:snakeyaml'
],
Expand Down

0 comments on commit 51f108a

Please sign in to comment.