Build: Provide option to prevent Class-Path in manifests (ticket #2317)

This commit is contained in:
zzz
2018-10-10 12:30:34 +00:00
parent 06914f9fd4
commit e68182a157
11 changed files with 37 additions and 10 deletions

View File

@ -25,9 +25,11 @@
</depend>
</target>
<!-- only used if not set by a higher build.xml -->
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<property name="require.gettext" value="true" />
<property name="manifest.classpath.name" value="Class-Path" />
<condition property="no.bundle">
<isfalse value="${require.gettext}" />
@ -79,7 +81,7 @@
<jar destfile="./build/i2psnark.jar" basedir="./build/obj" includes="**/*.class" excludes="**/web/* **/messages_*.class, **/standalone/*">
<manifest>
<attribute name="Main-Class" value="org.klomp.snark.CommandLine" />
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
<attribute name="${manifest.classpath.name}" value="i2p.jar mstreaming.jar streaming.jar" />
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />

View File

@ -30,6 +30,7 @@
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<property name="require.gettext" value="true" />
<property name="manifest.classpath.name" value="Class-Path" />
<!-- Compile includes ui/ classes but not web/ classes here -->
<target name="compile" depends="depend">
@ -83,7 +84,7 @@
<jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class" excludes="**/ui/*.class **/web/*.class" >
<manifest>
<attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
<attribute name="Class-Path" value="i2p.jar mstreaming.jar" />
<attribute name="${manifest.classpath.name}" value="i2p.jar mstreaming.jar" />
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
@ -324,6 +325,7 @@
<pathelement location="../../jetty/jettylib/jasper-el.jar" />
<pathelement location="../../jetty/jettylib/commons-el.jar" />
<pathelement location="../../jetty/jettylib/jetty-xml.jar" />
<pathelement location="../../jetty/jettylib/jetty-util.jar" />
<pathelement location="${ant.home}/lib/ant.jar" />
<pathelement location="build/i2ptunnel.jar" />
@ -358,6 +360,7 @@
<pathelement location="../../jetty/jettylib/tomcat-util-scan.jar" />
<pathelement location="../../jetty/jettylib/commons-el.jar" />
<pathelement location="../../jetty/jettylib/jetty-xml.jar" />
<pathelement location="../../jetty/jettylib/jetty-util.jar" />
<pathelement location="build/i2ptunnel.jar" />
<pathelement location="build/temp-beans.jar" />

View File

@ -25,6 +25,7 @@
<property name="verified.filename" value="verified.txt" />
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<property name="manifest.classpath.name" value="Class-Path" />
<!-- everything we need is in the deployer package, except for tomcat-api.jar in the full package,
so we just use the full package instead.
@ -410,7 +411,7 @@
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<!-- needed by JettyStart for pre-0.7.5 wrapper.config -->
<attribute name="Class-Path" value="jetty-deploy.jar jetty-xml.jar" />
<attribute name="${manifest.classpath.name}" value="jetty-deploy.jar jetty-xml.jar" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
<attribute name="X-Compile-Source-JDK" value="${javac.version}" />
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />

View File

@ -19,8 +19,10 @@
</depend>
</target>
<!-- only used if not set by a higher build.xml -->
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<property name="manifest.classpath.name" value="Class-Path" />
<target name="compile" depends="depend">
<mkdir dir="./build" />
@ -60,7 +62,7 @@
<property name="workspace.changes.tr" value="" />
<jar destfile="./build/jrobin.jar" basedir="./build/obj" includes="**/*.class">
<manifest>
<attribute name="Class-Path" value="i2p.jar" />
<attribute name="${manifest.classpath.name}" value="i2p.jar" />
<attribute name="Implementation-Version" value="1.6.0-1" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />

View File

@ -24,6 +24,7 @@
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<property name="require.gettext" value="true" />
<property name="manifest.classpath.name" value="Class-Path" />
<condition property="no.bundle">
<isfalse value="${require.gettext}" />
@ -76,7 +77,7 @@
<property name="workspace.changes.tr" value="" />
<jar destfile="./build/mstreaming.jar" basedir="./build/obj" includes="**/*.class" >
<manifest>
<attribute name="Class-Path" value="i2p.jar streaming.jar" />
<attribute name="${manifest.classpath.name}" value="i2p.jar streaming.jar" />
<attribute name="Specification-Title" value="I2P Streaming API" />
<attribute name="Specification-Version" value="${release.number}" />
<attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />

View File

@ -46,8 +46,10 @@
</dependset>
</target>
<!-- only used if not set by a higher build.xml -->
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<property name="manifest.classpath.name" value="Class-Path" />
<target name="compile" depends="prepare, depend, dependVersion">
<mkdir dir="./build" />
@ -128,7 +130,7 @@
<!-- DTG added in 0.8.4, not in the classpath for very old installs, before we changed wrapper.config to specify * -->
<!-- very old installs don't have i2psnark,jstl,standard in the classpath... not added in WebAppConfiguration any more -->
<!-- All new jetty 7 jars should have been in 0.9.6, added in 0.9.7 -->
<attribute name="Class-Path" value="i2p.jar router.jar jrobin.jar desktopgui.jar i2psnark.jar jstl.jar standard.jar jstlel.jar jetty-continuation.jar jetty-http.jar jetty-io.jar jetty-security.jar jetty-servlet.jar jetty-servlets.jar jetty-util.jar jetty-webapp.jar" />
<attribute name="${manifest.classpath.name}" value="i2p.jar router.jar jrobin.jar desktopgui.jar i2psnark.jar jstl.jar standard.jar jstlel.jar jetty-continuation.jar jetty-http.jar jetty-io.jar jetty-security.jar jetty-servlet.jar jetty-servlets.jar jetty-util.jar jetty-webapp.jar" />
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />

View File

@ -22,8 +22,10 @@
</depend>
</target>
<!-- only used if not set by a higher build.xml -->
<property name="javac.compilerargs7" value="" />
<property name="javac.version" value="1.7" />
<property name="manifest.classpath.name" value="Class-Path" />
<!-- compile everything including client classes -->
<target name="compile" depends="depend">
@ -71,7 +73,7 @@
<jar destfile="./build/sam.jar" basedir="./build/obj" includes="**/*.class" excludes="net/i2p/sam/client/*">
<manifest>
<attribute name="Main-Class" value="net.i2p.sam.SAMBridge" />
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
<attribute name="${manifest.classpath.name}" value="i2p.jar mstreaming.jar streaming.jar" />
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />

View File

@ -170,3 +170,8 @@ javac.version=1.7
# Debian: Not in wheezy/jessie
# Ubuntu: Only in wily and later
#with-libhttpclient-java=true
### Redhat packages ###
# uncomment to prevent classpaths in jar manifests
# https://fedoraproject.org/wiki/Packaging:Java
# without-manifest-classpath=true

View File

@ -443,11 +443,13 @@
<copy file="apps/jrobin/java/build/jrobin.jar" todir="build/" />
</target>
<target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber, setBuildTimestamp" >
<target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber, setBuildTimestamp, disableManifestClasspath" >
<!-- default if not set above -->
<property name="workspace.version" value="unknown" />
<!-- default if not set by setBuildTimestamp -->
<property name="build.timestamp" value="reproducible" />
<!-- default if not set by disableManifestClasspath -->
<property name="manifest.classpath.name" value="Class-Path" />
<property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
<echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
</target>
@ -458,6 +460,11 @@
</tstamp>
</target>
<!-- Disable Class-Path in jar manifests by renaming it (Fedora) -->
<target name="disableManifestClasspath" if="${without-manifest-classpath}" >
<property name="manifest.classpath.name" value="Disabled-Class-Path" />
</target>
<target name="buildWEB" depends="buildRouterConsole" >
<copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
<copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />

View File

@ -20,6 +20,7 @@
<property name="javac.compilerargs" value="" />
<property name="javac.classpath" value="" />
<property name="javac.version" value="1.7" />
<property name="manifest.classpath.name" value="Class-Path" />
<!-- fixups if we're using libintl.jar for GettextResource.java -->
<condition property="source.exclude1" value="gnu/gettext/GettextResource.java" else="NOTHING" >
@ -96,7 +97,7 @@
<!-- the getopt translation files -->
<fileset dir="src" includes="${translation.includes}" />
<manifest>
<attribute name="Class-Path" value="${gettext.jar} ${getopt.jar} ${httpclient.jar}" />
<attribute name="${manifest.classpath.name}" value="${gettext.jar} ${getopt.jar} ${httpclient.jar}" />
<attribute name="Specification-Title" value="I2P Core API" />
<attribute name="Specification-Version" value="${release.number}" />
<attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />

View File

@ -34,6 +34,7 @@
<!-- only used if not set by a higher build.xml -->
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<property name="manifest.classpath.name" value="Class-Path" />
<target name="compile" depends="depend, dependVersion">
<mkdir dir="./build" />
@ -66,7 +67,7 @@
<jar destfile="./build/router.jar" basedir="./build/obj" includes="**/*.class" >
<manifest>
<!-- so people with very old wrapper.config files will still work with Jetty 6 -->
<attribute name="Class-Path" value="i2p.jar addressbook.jar jetty-i2p.jar jetty-rewrite-handler.jar jetty-start.jar jetty-util.jar" />
<attribute name="${manifest.classpath.name}" value="i2p.jar addressbook.jar jetty-i2p.jar jetty-rewrite-handler.jar jetty-start.jar jetty-util.jar" />
<attribute name="Specification-Title" value="I2P Router" />
<attribute name="Specification-Version" value="${release.number}" />
<attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />