My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 121 attachment: retro.patch (7.8 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
### Eclipse Workspace Patch 1.0
#P jmesa-trunk
Index: build.groovy
===================================================================
--- build.groovy (revision 2007)
+++ build.groovy (working copy)
@@ -12,7 +12,7 @@
def libDir = "$targetDir/ivy/lib"
def distDir = "${targetDir}/dist"
def docsDir = "${targetDir}/docs"
-
+
def testDir = "${targetDir}/test"
def testClassesDir = "${testDir}/classes"
def testDataDir = "${testDir}/data"
@@ -110,6 +110,7 @@
ant.copy(todir:zipDir + '/source') { fileset(dir:'src') }
ant.copy(todir:zipDir + '/images') { fileset(dir:resourcesDir + '/images') }
ant.copy(todir:zipDir + '/dist', file:targetDir + "/${artifact.name}-${artifact.revision}.jar")
+ ant.copy(todir:zipDir + '/dist', file:retroDir + "/${artifact.name}-${artifact.revision}-retro.jar", failonerror: false)
ant.copy(todir:zipDir + '/dist', file:resourcesDir + '/jmesa.js')
ant.copy(todir:zipDir + '/dist', file:resourcesDir + '/jmesa-min.js')
ant.copy(todir:zipDir + '/dist', file:resourcesDir + '/jmesa.css')
@@ -184,10 +185,10 @@
*/
def lib() {
def libDir = 'lib'
- ant.mkdir(dir:libDir)
- ivy.configure(file:'ivyconf.xml')
- ivy.resolve(file:'ivy.xml')
- ivy.retrieve(pattern:"$libDir/[artifact]-[revision].[ext]", sync:true, conf:'test')
+ ant.mkdir(dir:libDir)
+ ivy.configure(file:'ivyconf.xml')
+ ivy.resolve(file:'ivy.xml')
+ ivy.retrieve(pattern:"$libDir/[artifact]-[revision].[ext]", sync:true, conf:'test')
}

def dist() {
@@ -200,6 +201,8 @@
compile()
jar()
ivypublish()
+ if (jreDir)
+ retro()
testClasspaths()
testCompile()
junit()
@@ -207,11 +210,12 @@
zip()
docs()
}
-
+
static void main(args) {
- def cli = new CliBuilder(usage:'groovy build.groovy -[ha]')
+ def cli = new CliBuilder(usage:'groovy build.groovy -[ha] [-j]')
cli.h(longOpt: 'help', 'usage information')
- cli.a(argName:'action', longOpt:'action', args:1, required:true, 'action(s) [dist, clean, lib]')
+ cli.a(argName:'action', longOpt:'action', args:1, required:true, 'action(s) [dist, clean, lib, retro]')
+ cli.j(argName: 'JDK 1.4 Home', longOpt: 'jrehome', args:1, required: false, 'the JDK 1.4 base directory for to link against for backporting')

def options = cli.parse(args)

@@ -221,9 +225,67 @@
}

def build = new Build(options.a == 'clean' || options.a == 'lib')
+ build.jreDir = options.j ? new java.io.File(options.j) : null
def action = options.a
build.invokeMethod(action, null)
}
+
+ def retroDir = "${targetDir}/retro"
+ def retroClassesDir = "${retroDir}/classes";
+ def jreDir
+
+ def retro() {
+ if (!jreDir) {
+ ant.echo(message: "Please select the base directory of a 1.4 JRE:")
+ def chooser = new javax.swing.JFileChooser()
+ chooser.fileSelectionMode = javax.swing.JFileChooser.DIRECTORIES_ONLY
+ chooser.multiSelectionEnabled = false
+ chooser.showDialog(null, "Use as JRE 1.4 Home")
+ jreDir = chooser.selectedFile
+ if (jreDir)
+ ant.echo(message: "Note: To automate the retro transformation, you can specify the JDK 1.4 base directory on the command line:\nex: groovy build.groovy -a retro -j \"" + jreDir + "\"");
+ }
+ if (!jreDir) {
+ ant.echo(message: "A JRE 1.4 base directory is required.")
+ return
+ }
+ if (!jreDir.exists()) {
+ ant.echo(message: "The specified JRE 1.4 base directory does not exist!")
+ return
+ }
+ if (!jreDir.isDirectory()) {
+ ant.echo(message: "The specified JRE 1.4 base directory is not a directory!")
+ return
+ }
+ ant.path(id: 'retro.compiler.classpath') {
+ fileset(dir:"$jreDir/lib", includes:'*.jar')
+ }
+ ant.path(id: 'compiled.classes') {
+ pathelement(path: classesDir)
+ }
+ ant.taskdef(
+ name: "retro",
+ classname: "org.jboss.ant.tasks.retro.Retro",
+ classpathref: "compile.classpath"
+ );
+ ant.delete(dir: retroClassesDir, failonerror: "false")
+ ant.mkdir(dir: retroClassesDir);
+ ant.retro(
+ compilerclasspathref: "retro.compiler.classpath",
+ destDir: retroClassesDir) {
+ classpath(refid: "compiled.classes")
+ classpath(refid: "compile.classpath")
+ src(path: classesDir)
+ };
+ ant.copy(todir:retroClassesDir) {
+ fileset(dir:"$projectDir/src", includes:sourceFilesTocopy)
+ }
+ def jarFile = "$retroDir/${artifact.name}-${artifact.revision}-retro.jar"
+ ant.copy(todir: retroClassesDir + '/META-INF', file:resourcesDir + '/jmesa.tld')
+ ant.jar(destfile:jarFile) {
+ fileset(dir:retroClassesDir)
+ }
+ }
}

class AntLibHelper {
Index: ivy.xml
===================================================================
--- ivy.xml (revision 2007)
+++ ivy.xml (working copy)
@@ -17,7 +17,8 @@
<dependency org="commons-lang" name="commons-lang" rev="2.2" conf="compile->default" />
<dependency org="groovy" name="groovy" rev="1.0" conf="compile->default" />
<dependency org="javax.servlet" name="jsp-api" rev="2.0" conf="compile->default" />
- <dependency org="javax.servlet" name="servlet-api" rev="2.4" conf="compile->default" />
+ <dependency org="javax.servlet" name="servlet-api" rev="2.4" conf="compile->default" />
+ <dependency org="javax.portlet" name="portlet-api" rev="2.0" conf="compile->default" />
<dependency org="jexcel" name="jexcel" rev="2.6.6" conf="compile->default" />
<dependency org="junit" name="junit" rev="4.3.1" conf="test->default" />
<dependency org="log4j" name="log4j" rev="1.2.13" conf="compile->default" />
@@ -28,12 +29,17 @@
<dependency org="org.springframework" name="spring-core" rev="2.5.5" conf="compile->default" />
<dependency org="org.springframework" name="spring-test" rev="2.5.5" conf="compile->default;test->default" />
<dependency org="org.springframework" name="spring-context" rev="2.5.5" conf="compile->default" />
- <dependency org="org.springframework" name="spring-web" rev="2.5.5" conf="compile->default;test->default" />
+ <dependency org="org.springframework" name="spring-web" rev="2.5.5" conf="compile->default;test->default" />
+ <dependency org="org.springframework" name="spring-webmvc-portlet" rev="2.5.5" conf="compile->default;test->default" />
<dependency org="poi" name="poi" rev="3.0-FINAL" conf="compile->default" />
<dependency org="xhtmlrenderer" name="core-renderer" rev="R8pre1" conf="compile->default" />
<dependency org="xhtmlrenderer" name="itext-paulo" rev="155" conf="compile->default" />
<dependency org="xwork" name="xwork" rev="2.0.5" conf="compile->default" />
- <dependency org="tagsoup" name="tagsoup" rev="1.1.3" conf="compile->default" />
+ <dependency org="tagsoup" name="tagsoup" rev="1.1.3" conf="compile->default" />
+ <dependency org="javassist" name="javassist" rev="3.8.0.GA" conf="compile->default" />
+ <dependency org="jboss" name="jboss-retro" rev="1.1.2" conf="compile->default" />
+ <dependency org="jboss" name="jboss-retro-rt" rev="1.1.2" conf="compile->default" />
+ <dependency org="jboss" name="backport-concurrent" rev="2.1.0.GA" conf="compile->default" />
</dependencies>
</ivy-module>

Powered by Google Project Hosting