From 0bbedd092a1f0f506d106943b4b400c7986c5f36 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 29 May 2020 00:17:20 +0200 Subject: [build] rewriting the build system --- buildScripts/compile.ant.xml | 309 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 309 insertions(+) create mode 100644 buildScripts/compile.ant.xml (limited to 'buildScripts/compile.ant.xml') diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml new file mode 100644 index 00000000..a68d6dc1 --- /dev/null +++ b/buildScripts/compile.ant.xml @@ -0,0 +1,309 @@ + + + +This buildfile is part of projectlombok.org. It takes care of compiling and building lombok itself. + + + + + + + + + + + + + + + + + + + Lombok version: ${lombok.version} (${lombok.fullversion}) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lombok.launch.AnnotationProcessorHider$AnnotationProcessor +lombok.launch.AnnotationProcessorHider$ClaimingProcessor + + lombok.launch.AnnotationProcessorHider$AnnotationProcessor,isolating +lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating + + + + + + + + + + + + + + + + + + + + + + + ${release.timestamp} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit From 88918e9eb3e65645fddd0f5f850795ce3fec25df Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 2 Jul 2020 23:34:07 +0200 Subject: [build] fixed a build issue (on 'ant dist') on windows. apparently on windows symlinking requires admin rights because ????? This can be fixed with an explicit update to group policies, which I can't assume anybody working on lombok is going to actually do. /bin/ln in msysgit just copies (interesting choice). I could write a mechanism that tries /bin/ln and if not there, try instead, either in the build scripts or in ivyplusplus, but that's way too much effort to avoid a 2MB copy. So, for now, we just copy... if more symlinking is to be done later, we'll revisit, though. copying is such a silly waste of time, slowing down the build for no reason. --- buildScripts/compile.ant.xml | 2 +- buildScripts/maven.ant.xml | 4 ++-- buildScripts/setup.ant.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'buildScripts/compile.ant.xml') diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml index a68d6dc1..0bcc55bb 100644 --- a/buildScripts/compile.ant.xml +++ b/buildScripts/compile.ant.xml @@ -294,7 +294,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating - + diff --git a/buildScripts/maven.ant.xml b/buildScripts/maven.ant.xml index 329eacec..dcba2ccb 100644 --- a/buildScripts/maven.ant.xml +++ b/buildScripts/maven.ant.xml @@ -37,7 +37,7 @@ This buildfile is part of projectlombok.org. It makes maven-compatible repositor - + @@ -48,7 +48,7 @@ This buildfile is part of projectlombok.org. It makes maven-compatible repositor - + diff --git a/buildScripts/setup.ant.xml b/buildScripts/setup.ant.xml index c72517c8..d6713222 100644 --- a/buildScripts/setup.ant.xml +++ b/buildScripts/setup.ant.xml @@ -36,7 +36,7 @@ This buildfile is part of projectlombok.org. It sets up the build itself. - + Your ssh.configuration file is corrupted; delete it and rerun this script. -- cgit From cb7e4a9ef3f02d5a543f99d013b5034f50732293 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 3 Jul 2020 05:31:34 +0200 Subject: [build] propagate chosen bootclasspath into eclipse test targets --- buildScripts/compile.ant.xml | 18 +++++++++--------- buildScripts/create-eclipse-project.ant.xml | 2 ++ buildScripts/setup.ant.xml | 10 +++++----- buildScripts/tests.ant.xml | 6 +++--- .../lombok/eclipseCreate/CreateEclipseDebugTarget.java | 18 ++++++++++++++++-- test/core/src/lombok/AbstractRunTests.java | 4 ++-- test/core/src/lombok/LombokTestSource.java | 4 ++++ test/core/src/lombok/RunTestsViaDelombok.java | 2 +- test/core/src/lombok/RunTestsViaEcj.java | 11 +++++++---- 9 files changed, 49 insertions(+), 26 deletions(-) (limited to 'buildScripts/compile.ant.xml') diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml index 0bcc55bb..f0c0ef7e 100644 --- a/buildScripts/compile.ant.xml +++ b/buildScripts/compile.ant.xml @@ -30,7 +30,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil - + @@ -73,11 +73,11 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil However, the stubs themselves also have a ton of dependencies; to avoid _that_, we have stubs for stubs, too! --> - + - + @@ -108,19 +108,19 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil - + - + - + @@ -129,7 +129,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil - + @@ -141,7 +141,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil use API that didn't exist in those versions yet. --> - + @@ -157,7 +157,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil - + diff --git a/buildScripts/create-eclipse-project.ant.xml b/buildScripts/create-eclipse-project.ant.xml index 386ed3de..89e2f91f 100644 --- a/buildScripts/create-eclipse-project.ant.xml +++ b/buildScripts/create-eclipse-project.ant.xml @@ -69,6 +69,7 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede + @@ -82,6 +83,7 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede + diff --git a/buildScripts/setup.ant.xml b/buildScripts/setup.ant.xml index d6713222..6ab23897 100644 --- a/buildScripts/setup.ant.xml +++ b/buildScripts/setup.ant.xml @@ -29,9 +29,9 @@ This buildfile is part of projectlombok.org. It sets up the build itself. - + - + @@ -121,10 +121,10 @@ This buildfile is part of projectlombok.org. It sets up the build itself. - + To ensure stable builds and avoid accessing API that was not available in JDK6, most of lombok is set up to build against OpenJDK6's runtime, which will now be downloaded... - + @@ -133,7 +133,7 @@ This buildfile is part of projectlombok.org. It sets up the build itself. - + Supply ant with -Ddeps.conf=confname to pick the configuration you want to fetch diff --git a/buildScripts/tests.ant.xml b/buildScripts/tests.ant.xml index 67edf28a..d8559c5c 100644 --- a/buildScripts/tests.ant.xml +++ b/buildScripts/tests.ant.xml @@ -30,7 +30,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn - + @@ -77,9 +77,9 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn Running TestJavac on JVM${ant.java.version}, with lowest supported javac: 1.6. - + - + diff --git a/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java b/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java index d3b314cb..d00524f7 100644 --- a/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java +++ b/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java @@ -93,6 +93,8 @@ public class CreateEclipseDebugTarget { throw new InvalidCommandLineException("Cannot obtain canonical path to parent directory", e); } + String bootpath = getBootPath(); + launchContent.append("\t\t\n"); for (Map.Entry entry : args.entrySet()) { if (!entry.getKey().startsWith("conf.")) continue; @@ -111,7 +113,7 @@ public class CreateEclipseDebugTarget { } } } - launchContent.append("\t\t\n"); + if (bootpath != null) launchContent.append("\t\t\n"); launchContent.append("\t\n"); } @@ -120,6 +122,7 @@ public class CreateEclipseDebugTarget { launchContent.append("\t\n"); String jvmTarget = getArgString("jvmTarget"); + String bootpath = getBootPath(); launchContent.append("\t\n"); launchContent.append("\t\n"); launchContent.append("\t\n"); @@ -129,10 +132,21 @@ public class CreateEclipseDebugTarget { if (!entry.getKey().startsWith("conf.")) continue; launchContent.append(File.pathSeparator).append(entry.getValue()); } - launchContent.append(" -Ddelombok.bootclasspath=lib/openjdk6_rt.jar\"/>\n"); + if (bootpath != null) launchContent.append(" -Ddelombok.bootclasspath=" + bootpath + "\"/>\n"); launchContent.append("\n"); } + private String getBootPath() { + String bp = args.get("bootpath"); + if (bp == null) return null; + File f = new File(bp); + if (!f.isAbsolute()) return bp; + String r = new File(".").getAbsolutePath(); + if (r.endsWith(".")) r = r.substring(0, r.length() - 1); + if (bp.startsWith(r)) return bp.substring(r.length()); + throw new IllegalStateException("Cannot reconstruct relative path; base: " + r + " is not a parent of " + bp); + } + private String getArgString(String key) throws InvalidCommandLineException { String v = args.get(key); if (v == null) throw new InvalidCommandLineException("mandatory argument '" + key + "' missing"); diff --git a/test/core/src/lombok/AbstractRunTests.java b/test/core/src/lombok/AbstractRunTests.java index d223ae03..6d2b6312 100644 --- a/test/core/src/lombok/AbstractRunTests.java +++ b/test/core/src/lombok/AbstractRunTests.java @@ -91,7 +91,7 @@ public abstract class AbstractRunTests { } }); - boolean changed = transformCode(messages, writer, file, sourceDirectives_.getSpecifiedEncoding(), sourceDirectives_.getFormatPreferences()); + boolean changed = transformCode(messages, writer, file, sourceDirectives_.getSpecifiedEncoding(), sourceDirectives_.getFormatPreferences(), sourceDirectives_.minVersion()); boolean forceUnchanged = sourceDirectives_.forceUnchanged() || sourceDirectives_.isSkipCompareContent(); if (params.expectChanges() && !forceUnchanged && !changed) messages.add(new CompilerMessage(-1, -1, true, "not flagged modified")); if (!params.expectChanges() && changed) messages.add(new CompilerMessage(-1, -1, true, "unexpected modification")); @@ -101,7 +101,7 @@ public abstract class AbstractRunTests { }; } - protected abstract boolean transformCode(Collection messages, StringWriter result, File file, String encoding, Map formatPreferences) throws Throwable; + protected abstract boolean transformCode(Collection messages, StringWriter result, File file, String encoding, Map formatPreferences, int minVersion) throws Throwable; protected String readFile(File file) throws IOException { BufferedReader reader; diff --git a/test/core/src/lombok/LombokTestSource.java b/test/core/src/lombok/LombokTestSource.java index b04f0ba0..57a32333 100644 --- a/test/core/src/lombok/LombokTestSource.java +++ b/test/core/src/lombok/LombokTestSource.java @@ -358,4 +358,8 @@ public class LombokTestSource { if (specifiedEncoding == null || specifiedEncoding.equalsIgnoreCase(encoding)) return source; return read0(sourceFolder, messagesFolder, fileName, specifiedEncoding); } + + public int minVersion() { + return Math.max(6, versionLowerLimit); + } } diff --git a/test/core/src/lombok/RunTestsViaDelombok.java b/test/core/src/lombok/RunTestsViaDelombok.java index b766e7a4..4260f2da 100644 --- a/test/core/src/lombok/RunTestsViaDelombok.java +++ b/test/core/src/lombok/RunTestsViaDelombok.java @@ -41,7 +41,7 @@ public class RunTestsViaDelombok extends AbstractRunTests { private static AtomicBoolean compilerVersionReported = new AtomicBoolean(); @Override - public boolean transformCode(Collection messages, StringWriter result, final File file, String encoding, Map formatPreferences) throws Throwable { + public boolean transformCode(Collection messages, StringWriter result, final File file, String encoding, Map formatPreferences, int version) throws Throwable { if (!compilerVersionReported.getAndSet(true)) System.out.println("Javac version: " + Javac.getJavaCompilerVersion()); delombok.setVerbose(true); ChangedChecker cc = new ChangedChecker(); diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java index 77d1b75e..ab28cb0c 100644 --- a/test/core/src/lombok/RunTestsViaEcj.java +++ b/test/core/src/lombok/RunTestsViaEcj.java @@ -93,7 +93,7 @@ public class RunTestsViaEcj extends AbstractRunTests { } @Override - public boolean transformCode(Collection messages, StringWriter result, File file, String encoding, Map formatPreferences) throws Throwable { + public boolean transformCode(Collection messages, StringWriter result, File file, String encoding, Map formatPreferences, int minVersion) throws Throwable { final AtomicReference compilationResult_ = new AtomicReference(); final AtomicReference compilationUnit_ = new AtomicReference(); ICompilerRequestor bitbucketRequestor = new ICompilerRequestor() { @@ -105,7 +105,7 @@ public class RunTestsViaEcj extends AbstractRunTests { String source = readFile(file); final CompilationUnit sourceUnit = new CompilationUnit(source.toCharArray(), file.getName(), encoding == null ? "UTF-8" : encoding); - Compiler ecjCompiler = new Compiler(createFileSystem(file), ecjErrorHandlingPolicy(), ecjCompilerOptions(), bitbucketRequestor, new DefaultProblemFactory(Locale.ENGLISH)) { + Compiler ecjCompiler = new Compiler(createFileSystem(file, minVersion), ecjErrorHandlingPolicy(), ecjCompilerOptions(), bitbucketRequestor, new DefaultProblemFactory(Locale.ENGLISH)) { @Override protected synchronized void addCompilationUnit(ICompilationUnit inUnit, CompilationUnitDeclaration parsedUnit) { if (inUnit == sourceUnit) compilationUnit_.set(parsedUnit); super.addCompilationUnit(inUnit, parsedUnit); @@ -129,7 +129,9 @@ public class RunTestsViaEcj extends AbstractRunTests { return true; } - private FileSystem createFileSystem(File file) { + private static final String bootRuntimePath = System.getProperty("delombok.bootclasspath"); + + private FileSystem createFileSystem(File file, int minVersion) { List classpath = new ArrayList(); for (Iterator i = classpath.iterator(); i.hasNext();) { if (FileSystem.getClasspath(i.next(), "UTF-8", null) == null) { @@ -138,7 +140,8 @@ public class RunTestsViaEcj extends AbstractRunTests { } if (new File("bin").exists()) classpath.add("bin"); classpath.add("dist/lombok.jar"); - classpath.add("lib/openjdk6_rt.jar"); + if (bootRuntimePath == null || bootRuntimePath.isEmpty()) throw new IllegalStateException("System property delombok.bootclasspath is not set; set it to the rt of java6 or java8"); + classpath.add(bootRuntimePath); for (File f : new File("lib/test").listFiles()) { String fn = f.getName(); if (fn.length() < 4) continue; -- cgit From a0eb13a4783209e84f406bbf43f7d9157d0f7fba Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 23 Jul 2020 23:51:50 +0200 Subject: [test] bugfix for the 'dist' step --- buildScripts/compile.ant.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'buildScripts/compile.ant.xml') diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml index f0c0ef7e..5baf50c3 100644 --- a/buildScripts/compile.ant.xml +++ b/buildScripts/compile.ant.xml @@ -294,7 +294,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating - + -- cgit