JaroslavTulach closed pull request #957: Fixing "ant clean", clean runs in
travis builds
URL: https://github.com/apache/incubator-netbeans/pull/957
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/.travis.yml b/.travis.yml
index 4e24d54a7e..8ed9f7ef93 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,8 +17,10 @@
language: java
script:
- if [ "x$RAT" == "xtrue" ]; then (ant -quiet build-source-config && mkdir
scratch && cd scratch && unzip -qq ../nbbuild/build/release-src* && ant -quiet
rat -Drat-report.haltonfailure=true && cd .. && rm -rf scratch); fi
- - if [ "x$OPTS" == "x" ]; then OPTS="-quiet build
-Djavac.compilerargs=-nowarn -Dbuild.compiler.deprecation=false"; fi
- - ant $OPTS
+ - if [ "x$OPTS" == "x" ]; then OPTS="-quiet -Djavac.compilerargs=-nowarn
-Dbuild.compiler.deprecation=false"; fi
+ - if [ "x$TARGET" == "x" ]; then TARGET="build"; fi
+ - ant $OPTS clean
+ - ant $OPTS $TARGET
- if [ "x$COMPILETEST" == "xtrue" ]; then ant -quiet test
-Djavac.compilerargs=-nowarn -Dbuild.compiler.deprecation=false
-Dtest.includes=NoTestsJustBuild; fi
- if [ "x$LICENSE" == "xtrue" ]; then ant -quiet verify-libs-and-licenses
-Dverify-libs-and-licenses.haltonfailure=true; fi
- if [ "x$EOL" == "xtrue" ]; then ./travis-check-line-endings.sh; fi
@@ -33,5 +35,5 @@ matrix:
- env: SIGTEST=true COMPILETEST=false RAT=false EOL=true LICENSE=false
CV=true
jdk: oraclejdk8
- - env: OPTS="build-platform -Dpermit.jdk9.builds=true
-Dvanilla.javac.exists=true"
+ - env: OPTS="-quiet -Dpermit.jdk9.builds=true
-Dvanilla.javac.exists=true" TARGET="build-platform"
jdk: oraclejdk11
diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java
b/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java
index b88933f591..4990f4ba0f 100644
--- a/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java
+++ b/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java
@@ -35,7 +35,6 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
@@ -85,7 +84,7 @@
static final String PROJECT_NS = "http://www.netbeans.org/ns/project/1";
static final String NBM_NS2 =
"http://www.netbeans.org/ns/nb-module-project/2";
static final String NBM_NS3 =
"http://www.netbeans.org/ns/nb-module-project/3";
-
+
private File moduleProject;
/**
* Set the NetBeans module project to work on.
@@ -836,6 +835,24 @@ private void translateModuleAutoDeps(String myCNB,
List<Dep> deps, List<URL> mod
if (moduleAutoDeps.isEmpty()) {
return;
}
+ // determine warning level
+ int warnLevel = Project.MSG_WARN;
+ String s = getProject().getProperty("nbbuild.warn.missing.autodeps");
+ if (null != s) {
+ if (Boolean.TRUE.toString().equalsIgnoreCase(s)) {
+ warnLevel = Project.MSG_WARN;
+ } else if (Boolean.FALSE.toString().equalsIgnoreCase(s)) {
+ warnLevel = Project.MSG_DEBUG + 100; // should be ignored even
when -d is present
+ } else switch (s.toLowerCase()) {
+ case "warn": warnLevel = Project.MSG_WARN; break;
+ case "err": warnLevel = Project.MSG_ERR; break;
+ case "info": warnLevel = Project.MSG_INFO; break;
+ case "verbose": warnLevel = Project.MSG_VERBOSE; break;
+ case "debug": warnLevel = Project.MSG_DEBUG; break;
+ default:
+ throw new BuildException("Invalid value of
nbbuild.warn.missing.autodeps property (" + s + "). See Project MSG_
constants.");
+ }
+ }
Set<String> depsS = new HashSet<>();
String result;
AntClassLoader loader = new AntClassLoader();
@@ -854,7 +871,7 @@ private void translateModuleAutoDeps(String myCNB,
List<Dep> deps, List<URL> mod
}
File jar = entry.getJar();
if (!jar.isFile()) {
- log("Cannot translate according to " + moduleAutoDeps + "
because could not find " + jar, Project.MSG_WARN);
+ log("Cannot translate according to " + moduleAutoDeps + "
because could not find " + jar, warnLevel);
return;
}
loader.addPathComponent(jar);
diff --git a/nbbuild/build.xml b/nbbuild/build.xml
index bdd7359ea6..badaf5b533 100644
--- a/nbbuild/build.xml
+++ b/nbbuild/build.xml
@@ -1127,7 +1127,11 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y
to start the system in d
<selection excludes="build_info"/>
</ducf>
</target>
-
+
+ <target name="-init-clean">
+ <property name="nbbuild.warn.missing.autodeps" value="verbose"/>
+ </target>
+
<target name="-cleanall" depends="init-module-list,init-tasks">
<taskdef name="cleanall" classname="org.netbeans.nbbuild.CleanAll"
classpath="${nbantext.jar}"/>
<cleanall topdir=".."
@@ -1138,7 +1142,7 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y
to start the system in d
failonerror="${stop.when.clean.error}" />
</target>
- <target name="clean" depends="bootstrap" description="Clean everything
possible.">
+ <target name="clean" depends="-init-clean,bootstrap" description="Clean
everything possible.">
<taskdef name="try-else" classname="org.netbeans.nbbuild.TryElse"
classpath="${nbantext.jar}"/>
<try-else first="-hg-clean" second="-real-clean"/>
</target>
diff --git a/webcommon/libs.jstestdriver/build.xml
b/webcommon/libs.jstestdriver/build.xml
index 59dfe7c53a..8881c0c68a 100644
--- a/webcommon/libs.jstestdriver/build.xml
+++ b/webcommon/libs.jstestdriver/build.xml
@@ -46,6 +46,6 @@
<target name="build-wrapper" depends="netbeans,ext-jar"/>
- <target name="-process.release.files"
depends="projectized.-process.release.files,ext-jar"/>
+ <target name="netbeans-extra"
depends="projectized-common.netbeans-extra,ext-jar"/>
</project>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists