]> source.dussan.org Git - aspectj.git/commitdiff
231963: implementation, allow -checkRuntimeVersion:true or false
authoraclement <aclement>
Tue, 13 May 2008 23:03:00 +0000 (23:03 +0000)
committeraclement <aclement>
Tue, 13 May 2008 23:03:00 +0000 (23:03 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java

index b63f6bf58c11391e4e0da1f56931c6063159f4b4..b8d925505a1366e89d992673eb3fcffb9e5263d0 100644 (file)
@@ -545,6 +545,15 @@ public class BuildArgParser extends Main {
                        } else if (arg.equals("-crossrefs")) {
                                buildConfig.setGenerateCrossRefsMode(true);
                                buildConfig.setGenerateModelMode(true);
+                       } else if (arg.startsWith("-checkRuntimeVersion:")) {
+                               String lcArg = arg.toLowerCase();
+                               if (lcArg.endsWith(":false")) {
+                                       buildConfig.setCheckRuntimeVersion(false);
+                               } else if (lcArg.endsWith(":true")) {
+                                       buildConfig.setCheckRuntimeVersion(true);
+                               } else {
+                                       showError("bad value for -checkRuntimeVersion option, must be true or false");
+                               }
                        } else if (arg.equals("-emacssym")) {
                                buildConfig.setEmacsSymMode(true);
                                buildConfig.setGenerateModelMode(true);
index 963951deeb9ff10d0fb279255af9ec7c560736b8..dc495fead3396190aa757bdbb9ba640f85adab26 100644 (file)
@@ -355,6 +355,11 @@ public class AjBuildConfig {
         if (!incrementalMode && global.incrementalMode) {
             incrementalMode = true;
         }
+        
+        if (isCheckRuntimeVersion() && !global.isCheckRuntimeVersion()) {
+               setCheckRuntimeVersion(false);
+        }
+        
         join(inJars, global.inJars);
         join(inPath, global.inPath);
         if ((null == lintMode) 
@@ -563,6 +568,14 @@ public class AjBuildConfig {
        public void setGenerateCrossRefsMode(boolean on) {
                options.generateCrossRefs = on;
        }
+
+       public boolean isCheckRuntimeVersion() {
+               return options.checkRuntimeVersion;
+       }
+       
+       public void setCheckRuntimeVersion(boolean on) {
+               options.checkRuntimeVersion = on;
+       }
        
        public boolean isEmacsSymMode() {
                return options.generateEmacsSymFiles;
index 2b62022178c3a24f5913cc128f621080bdd06788..13488e22487a8a4f53841bd34e7adc1569abb2d4 100644 (file)
@@ -218,18 +218,20 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
             this.handler = 
                 CountingMessageHandler.makeCountingMessageHandler(baseHandler);
 
-            if (DO_RUNTIME_VERSION_CHECK) {
-                String check = checkRtJar(buildConfig);
-                if (check != null) {
-                    if (FAIL_IF_RUNTIME_NOT_FOUND) {
-                        MessageUtil.error(handler, check);
-                        CompilationAndWeavingContext.leavingPhase(ct);
-                        return false;
-                    } else {
-                        MessageUtil.warn(handler, check);
-                    }
-                }
-            }
+               if (buildConfig==null || buildConfig.isCheckRuntimeVersion()) {
+                   if (DO_RUNTIME_VERSION_CHECK) {
+                       String check = checkRtJar(buildConfig);
+                       if (check != null) {
+                           if (FAIL_IF_RUNTIME_NOT_FOUND) {
+                               MessageUtil.error(handler, check);
+                               CompilationAndWeavingContext.leavingPhase(ct);
+                               return false;
+                           } else {
+                               MessageUtil.warn(handler, check);
+                           }
+                       }
+                   }
+               }
 
             // if (batch) {
                 setBuildConfig(buildConfig);
@@ -1189,8 +1191,10 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
                        return null;
                }
                
+               
                if (buildConfig == null || buildConfig.getFullClasspath() == null) return "no classpath specified";
                
+               
                String ret = null;
                for (Iterator it = buildConfig.getFullClasspath().iterator(); it.hasNext(); ) {
                        File p = new File( (String)it.next() );
index 469d7ea78dd94b6bf846a7be34cf8383a6842655..9ca9e7ea142368a8741c392e424420a17471fbe9 100644 (file)
@@ -94,6 +94,9 @@ public class AjCompilerOptions extends CompilerOptions {
         */
        public boolean generateCrossRefs = false;
        
+       // Check aspectjrt*.jar exists and within it the version number is right (see AjBuildManager.checkRtJar())
+       public boolean checkRuntimeVersion = true;
+       
        public boolean proceedOnError = false;