Skip to content
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
31 changes: 31 additions & 0 deletions build-support/prepare-sources.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,37 @@ if (command == 'generate-serializer') {
}
Files.move(generatedLexer.toPath(), lexer.toPath(), StandardCopyOption.REPLACE_EXISTING)
lexCopy.delete()
} else if (command == 'bundle-xalan') {
def classes = new File(moduleTarget, 'classes')
if (!classes.isDirectory()) {
throw new IllegalStateException("Compiled classes are missing: ${classes}")
}
def unpack = { File jar, List<String> prefixes ->
if (!jar.isFile()) {
throw new IllegalStateException("Bundle jar is missing: ${jar}")
}
def zip = new java.util.zip.ZipFile(jar)
try {
zip.entries().each { entry ->
if (entry.directory) {
return
}
def name = entry.name
if (!prefixes.any { name.startsWith(it) }) {
return
}
def out = new File(classes, name)
out.parentFile.mkdirs()
out.withOutputStream { output ->
zip.getInputStream(entry).withCloseable { input -> output << input }
}
}
} finally {
zip.close()
}
}
unpack(new File(repo, 'lib/regexp.jar'), ['org/apache/regexp/'])
unpack(new File(repo, 'lib/runtime.jar'), ['java_cup/runtime/'])
} else {
throw new IllegalArgumentException("Unknown command ${command}")
}
33 changes: 33 additions & 0 deletions xalan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,24 @@
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-bcel</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.bcel</groupId>
<artifactId>bcel</artifactId>
<version>${bcel.version}</version>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<includes>org/apache/bcel/**,META-INF/maven/org.apache.bcel/**</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand All @@ -122,6 +140,21 @@
<script><![CDATA[
xalanPrepareCommand = 'generate-xalan'
evaluate(new File(project.basedir, '../build-support/prepare-sources.groovy'))
]]></script>
</scripts>
</configuration>
</execution>
<execution>
<id>bundle-vendored-classes</id>
<phase>prepare-package</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scripts>
<script><![CDATA[
xalanPrepareCommand = 'bundle-xalan'
evaluate(new File(project.basedir, '../build-support/prepare-sources.groovy'))
]]></script>
</scripts>
</configuration>
Expand Down