changeset 19822:e87d55dfbbbb

trigger building all dependencies in NetBeans only when needed Contributed-by: Jaroslav Tulach <jaroslav.tulach@gmail.com>
author Doug Simon <doug.simon@oracle.com>
date Fri, 13 Mar 2015 11:26:37 +0100
parents c9e3131099fb
children 97da0b90e0f3 79682c7f2ec7
files mxtool/mx.py
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Fri Mar 13 11:06:10 2015 +0100
+++ b/mxtool/mx.py	Fri Mar 13 11:26:37 2015 +0100
@@ -4172,6 +4172,31 @@
     out.open('project', {'name' : p.name, 'default' : 'default', 'basedir' : '.'})
     out.element('description', data='Builds, tests, and runs the project ' + p.name + '.')
     out.element('import', {'file' : 'nbproject/build-impl.xml'})
+    out.open('target', {'name' : '-post-init'})
+    out.open('pathconvert', {'property' : 'comma.javac.classpath', 'pathsep' : ','})
+    out.element('path', {'path' : '${javac.classpath}'})
+    out.close('pathconvert')
+
+    out.open('restrict', {'id' : 'missing.javac.classpath'})
+    out.element('filelist', {'dir' : '${basedir}', 'files' : '${comma.javac.classpath}'})
+    out.open('not')
+    out.element('exists')
+    out.close('not')
+    out.close('restrict')
+
+    out.element('property', {'name' : 'missing.javac.classpath', 'refid' : 'missing.javac.classpath'})
+
+    out.open('condition', {'property' : 'no.dependencies', 'value' : 'true'})
+    out.element('equals', {'arg1' : '${missing.javac.classpath}', 'arg2' : ''})
+    out.close('condition')
+
+    out.element('property', {'name' : 'no.dependencies', 'value' : 'false'})
+
+    out.open('condition', {'property' : 'no.deps'})
+    out.element('equals', {'arg1' : '${no.dependencies}', 'arg2' : 'true'})
+    out.close('condition')
+
+    out.close('target')
     out.open('target', {'name' : '-post-compile'})
     out.open('exec', {'executable' : sys.executable})
     out.element('env', {'key' : 'JAVA_HOME', 'value' : jdk.jdk})