@@ -61,18 +61,28 @@ async function buildJosm(
6161 info ( "Cache hit for " + buildHit ) ;
6262 return ;
6363 }
64- const ivyFiles = await hashFiles ( "**/ivy.xml" ) ;
64+ const ivyFiles = await hashFiles ( "**/ivy.xml\n**/pom.xml " ) ;
6565 const ivyHit = await restoreCache (
66- [ "~/.ivy2/cache" , "~/.ant/cache" , josmSource + "/tools" ] ,
66+ [ "~/.ivy2/cache" , "~/.ant/cache" , "~/.m2" , josmSource + "/tools" ] ,
6767 `${ process . platform } -${ process . arch } -ivy-${ ivyFiles } ` ,
6868 ) ;
6969 if ( ivyHit == null || ivyHit === "" ) {
7070 await exec ( "ant" , [ "-buildfile" , josmSource + "/build.xml" , "resolve" ] ) ;
71+ await exec ( "mvn" , [ "clean" , "validate" ] ) ;
7172 await saveCache (
72- [ "~/.ivy2/cache" , "~/.ant/cache" , josmSource + "/tools" ] ,
73+ [ "~/.ivy2/cache" , "~/.ant/cache" , "~/.m2" , josmSource + "/tools" ] ,
7374 `${ process . platform } -${ process . arch } -ivy-${ ivyFiles } ` ,
7475 ) ;
7576 }
77+ // Build with maven
78+ await exec ( "mvn" , [
79+ "--file" ,
80+ josmSource + "/pom.xml" ,
81+ "package" ,
82+ "install" ,
83+ "-DskipTests" ,
84+ ] ) ;
85+ // And then ant, since that is currently the "official" distribution source.
7686 await exec ( "ant" , [ "-buildfile" , josmSource + "/build.xml" , "dist" ] ) ;
7787 await saveCache (
7888 [ josmSource + "/dist/josm-custom.jar" ] ,
@@ -94,19 +104,28 @@ async function buildJosmTests(
94104 return ;
95105 }
96106 await buildJosm ( josmSource , josmRevision ) ;
97- const ivyFiles = await hashFiles ( josmSource + "/**/ivy.xml" ) ;
107+ const ivyFiles = await hashFiles (
108+ josmSource + "/**/ivy.xml" + "\n" + josmSource + "/**/pom.xml" ,
109+ ) ;
98110 const ivyHit = await restoreCache (
99- [ "~/.ivy2/cache" , "~/.ant/cache" , josmSource + "/tools" ] ,
111+ [ "~/.ivy2/cache" , "~/.ant/cache" , "~/.m2" , josmSource + "/tools" ] ,
100112 `${ process . platform } -${ process . arch } -test-ivy-${ ivyFiles } ` ,
101113 ) ;
102114 if ( ivyHit == null || ivyHit === "" ) {
103115 await exec ( "ant" , [ "-buildfile" , josmSource + "/build.xml" , "test-init" ] ) ;
104116 await saveCache (
105- [ "~/.ivy2/cache" , "~/.ant/cache" , josmSource + "/tools" ] ,
117+ [ "~/.ivy2/cache" , "~/.ant/cache" , "~/.m2" , josmSource + "/tools" ] ,
106118 `${ process . platform } -${ process . arch } -test-ivy-${ ivyFiles } ` ,
107119 ) ;
108120 }
109121 await exec ( "ant" , [ "-buildfile" , josmSource + "/build.xml" , "test-compile" ] ) ;
122+ await exec ( "mvn" , [
123+ "--file" ,
124+ josmSource + "/test/pom.xml" ,
125+ "package" ,
126+ "install" ,
127+ "-DskipTests" ,
128+ ] ) ;
110129 await saveCache ( [ josmSource + "/test/build" ] , `josm-tests-r${ josmRevision } ` ) ;
111130}
112131
0 commit comments