提交 5a01e1c5 编写于 作者: K kohsuke

finally getting rid of 1.4 support. yay!


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2862 71c3de6d-444a-0410-be80-ed276b4c234a
上级 70a78dbd
......@@ -47,29 +47,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create14jar</id>
<phase>package</phase>
<configuration>
<tasks>
<taskdef name="retrotranslator" classpathref="maven.test.classpath" classname="net.sf.retrotranslator.transformer.RetrotranslatorTask" />
<mkdir dir="target/classes14" />
<!-- pick up the manfiest -->
<unjar src="target/${artifactId}-${version}.jar" dest="target">
<patternset>
<include name="META-INF/MANIFEST.MF" />
</patternset>
</unjar>
<retrotranslator srcdir="target/classes" destdir="target/classes14" /><!-- verify="true" detects false-positive errors against some references to remoting-->
<jar basedir="target/classes14" destfile="target/${artifactId}-${version}-jdk14.jar" manifest="target/META-INF/MANIFEST.MF" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<phase>generate-resources</phase>
<configuration>
......@@ -83,9 +60,6 @@
<mkdir dir="target/classes/hudson" />
<echo file="target/classes/hudson/hudson-version.properties">version=${build.version}
</echo>
<mkdir dir="target/classes14/hudson" />
<echo file="target/classes14/hudson/hudson-version.properties">version=${build.version}
</echo>
</tasks>
</configuration>
<goals>
......@@ -94,31 +68,6 @@
</execution>
</executions>
</plugin>
<!--
Attach the generated 1.4 jar to the build so that it gets deployed to the repo.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/${artifactId}-${version}-jdk14.jar</file>
<type>jar</type>
<classifier>jdk14</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<!-- set main class -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
......@@ -141,46 +90,9 @@
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>remoting</artifactId>
<version>${version}</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<!--
To build the remoting and core modules both retrotranslated
(and still while writing the core code with generics),
it is necessary to build both in one compilation. So in
the release mode, we add the remoting source tree as a part
of the core.
Instead, in the debug profile we depends on the separately built remoting module,
so that IDEs won't get confused with "duplicate code"
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<configuration>
<sources>
<source>../remoting/src/main/java</source>
</sources>
</configuration>
<executions>
<execution>
<goals>
<goal>add-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<!-- for releases, just use the POM version. See above ant-run plugin for how this gets used. -->
<build.version>${version}</build.version>
......@@ -189,6 +101,11 @@
</profiles>
<dependencies>
<dependency>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>remoting</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
......@@ -204,21 +121,6 @@
<artifactId>maven-agent</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<!--
marked as test dependency so that I can still use it in the antrun plugin but
it won't show up as a public dependency
-->
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-transformer</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler</artifactId>
......
package hudson.util;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import net.sf.retrotranslator.runtime.java.lang.Enum_;
/**
* Converts retrotranslator's enum class to make it match with JDK5's native data format.
*
*
* @author Kohsuke Kawaguchi
*/
public class RetrotranslatorEnumConverter implements Converter {
public boolean canConvert(Class type) {
return Enum_.class.isAssignableFrom(type);
}
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
writer.setValue(((Enum_)source).name());
}
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
Class type = context.getRequiredType();
if (type.getSuperclass() != Enum_.class) {
type = type.getSuperclass(); // polymorphic enums
}
String value = reader.getValue();
if(value==null || value.trim().length()==0) {
/*
backward compatibility mode. read retroweaver's format from:
<mode>
<description>Leave this machine for tied jobs only</description>
<ordinal>1</ordinal>
<name>EXCLUSIVE</name>
</mode>
*/
while(reader.hasMoreChildren()) {
reader.moveDown();
if(reader.getNodeName().equals("name"))
value = reader.getValue();
reader.moveUp();
}
}
return Enum_.valueOf(type, value);
}
}
......@@ -39,7 +39,7 @@ public class XStream2 extends XStream {
private void init() {
registerConverter(new RobustCollectionConverter(getClassMapper()),10);
registerConverter(new RetroweaverEnumConverter(),10);
registerConverter(new RetrotranslatorEnumConverter(),10);
//registerConverter(new RetrotranslatorEnumConverter(),10);
registerConverter(new CopyOnWriteList.ConverterImpl(getClassMapper()),10);
registerConverter(new DescribableList.ConverterImpl(getClassMapper()),10);
......
......@@ -25,105 +25,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<!--
create uberjar for jdk14.
-->
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>uberjar</id>
<phase>package</phase>
<goals>
<!--
Work around for http://jira.codehaus.org/browse/MASSEMBLY-97 as the goal should be attached.
-->
<goal>single</goal>
</goals>
<configuration>
<finalName>remoting-${version}</finalName>
<descriptors>
<descriptor>assembly-uberjar-14.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>hudson.remoting.Launcher</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<!--
Generate retrotranslated 1.4 jar "on the side". I tried various approaches like
"profile" (like http://testng.googlecode.com/svn/trunk/pom.xml), but in the
end using Ant seems to be the easiest.
-->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create14jar</id>
<phase>process-classes</phase><!-- do this earlier than the package phase so that the assembly plugin can create uberjars for 14 classes -->
<configuration>
<tasks>
<taskdef name="retrotranslator" classpathref="maven.test.classpath" classname="net.sf.retrotranslator.transformer.RetrotranslatorTask" />
<mkdir dir="target/classes14" />
<retrotranslator srcdir="target/classes" destdir="target/classes14" /><!-- verify="true" detects false-positive errors against some references to remoting-->
<jar basedir="target/classes14" destfile="target/${artifactId}-${version}-jdk14.jar">
<manifest>
<attribute name="Main-Class" value="hudson.remoting.Launcher" />
</manifest>
</jar>
<!-- see ../jnlp-agent/pom.xml for details -->
<signjar jar="target/${artifactId}-${version}-jdk14.jar" alias="${hudson.sign.alias}" keystore="${hudson.sign.keystore}" storepass="${hudson.sign.storepass}" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<!-- sign uberjar, which is used as slave.jar in the release profile -->
<execution>
<id>signUberjar</id>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!-- see ../jnlp-agent/pom.xml for details -->
<signjar jar="target/${artifactId}-${version}-jdk14-jar-with-dependencies.jar" alias="${hudson.sign.alias}" keystore="${hudson.sign.keystore}" storepass="${hudson.sign.storepass}" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<!--
Attach the generated 1.4 jar to the build so that it gets deployed to the repo.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/${artifactId}-${version}-jdk14.jar</file>
<type>jar</type>
<classifier>jdk14</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
......@@ -157,21 +58,6 @@
</build>
<dependencies>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<!--
marked as test dependency so that I can still use it in the antrun plugin but
it won't show up as a public dependency
-->
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-transformer</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
......
......@@ -87,7 +87,6 @@
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>remoting</artifactId>
<version>${version}</version>
<classifier>${hudsonRemotingClassifier}</classifier>
<destFileName>slave.jar</destFileName>
</artifactItem>
</artifactItems>
......@@ -109,7 +108,6 @@
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>remoting</artifactId>
<version>${version}</version>
<classifier>${hudsonRemotingClassifier}</classifier>
<destFileName>remoting.jar</destFileName>
</artifactItem>
</artifactItems>
......@@ -199,26 +197,6 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>debug</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<hudsonClassifier />
<hudsonRemotingClassifier />
</properties>
</profile>
<profile>
<id>release</id>
<properties>
<hudsonClassifier>jdk14</hudsonClassifier>
<hudsonRemotingClassifier>jdk14-jar-with-dependencies</hudsonRemotingClassifier>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
......@@ -235,7 +213,6 @@
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>hudson-core</artifactId>
<version>${version}</version>
<classifier>${hudsonClassifier}</classifier>
<exclusions>
<!-- jars that are not needed in war -->
<exclusion>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册