comparison mxtool/mx.py @ 17075:c24ea91c30ba

create generated source dirs as part of netbeansinit
author Doug Simon <doug.simon@oracle.com>
date Tue, 09 Sep 2014 13:32:08 +0200
parents 75a4acd33159
children f0b55d0c5d2d
comparison
equal deleted inserted replaced
17074:899dd861f081 17075:c24ea91c30ba
3976 out.element('name', data=p.name) 3976 out.element('name', data=p.name)
3977 out.element('explicit-platform', {'explicit-source-supported' : 'true'}) 3977 out.element('explicit-platform', {'explicit-source-supported' : 'true'})
3978 out.open('source-roots') 3978 out.open('source-roots')
3979 out.element('root', {'id' : 'src.dir'}) 3979 out.element('root', {'id' : 'src.dir'})
3980 if len(p.annotation_processors()) > 0: 3980 if len(p.annotation_processors()) > 0:
3981 out.element('root', {'id' : 'src.ap-source-output.dir'}) 3981 out.element('root', {'id' : 'src.ap-source-output.dir', 'name' : 'Generated Packages'})
3982 out.close('source-roots') 3982 out.close('source-roots')
3983 out.open('test-roots') 3983 out.open('test-roots')
3984 out.close('test-roots') 3984 out.close('test-roots')
3985 out.close('data') 3985 out.close('data')
3986 3986
3987 firstDep = True 3987 firstDep = True
3988 for dep in p.all_deps([], True): 3988 for dep in p.all_deps([], includeLibs=False, includeAnnotationProcessors=True):
3989 if dep == p: 3989 if dep == p:
3990 continue 3990 continue
3991 3991
3992 if dep.isProject(): 3992 if dep.isProject():
3993 n = dep.name.replace('.', '_') 3993 n = dep.name.replace('.', '_')
4018 annotationProcessorEnabled = "false" 4018 annotationProcessorEnabled = "false"
4019 annotationProcessorReferences = "" 4019 annotationProcessorReferences = ""
4020 annotationProcessorSrcFolder = "" 4020 annotationProcessorSrcFolder = ""
4021 if len(p.annotation_processors()) > 0: 4021 if len(p.annotation_processors()) > 0:
4022 annotationProcessorEnabled = "true" 4022 annotationProcessorEnabled = "true"
4023 annotationProcessorSrcFolder = "src.ap-source-output.dir=${build.generated.sources.dir}/ap-source-output" 4023 genSrcDir = p.source_gen_dir()
4024 if not exists(genSrcDir):
4025 os.makedirs(genSrcDir)
4026 annotationProcessorSrcFolder = "src.ap-source-output.dir=" + genSrcDir
4024 4027
4025 content = """ 4028 content = """
4026 annotation.processing.enabled=""" + annotationProcessorEnabled + """ 4029 annotation.processing.enabled=""" + annotationProcessorEnabled + """
4027 annotation.processing.enabled.in.editor=""" + annotationProcessorEnabled + """ 4030 annotation.processing.enabled.in.editor=""" + annotationProcessorEnabled + """
4028 annotation.processing.processors.list= 4031 annotation.processing.processors.list=
4031 application.vendor=mx 4034 application.vendor=mx
4032 build.classes.dir=${build.dir} 4035 build.classes.dir=${build.dir}
4033 build.classes.excludes=**/*.java,**/*.form 4036 build.classes.excludes=**/*.java,**/*.form
4034 # This directory is removed when the project is cleaned: 4037 # This directory is removed when the project is cleaned:
4035 build.dir=bin 4038 build.dir=bin
4036 build.generated.dir=${build.dir}/generated
4037 build.generated.sources.dir=${build.dir}/generated-sources 4039 build.generated.sources.dir=${build.dir}/generated-sources
4038 # Only compile against the classpath explicitly listed here: 4040 # Only compile against the classpath explicitly listed here:
4039 build.sysclasspath=ignore 4041 build.sysclasspath=ignore
4040 build.test.classes.dir=${build.dir}/test/classes 4042 build.test.classes.dir=${build.dir}/test/classes
4041 build.test.results.dir=${build.dir}/test/results 4043 build.test.results.dir=${build.dir}/test/results
4052 endorsed.classpath= 4054 endorsed.classpath=
4053 excludes= 4055 excludes=
4054 includes=** 4056 includes=**
4055 jar.compress=false 4057 jar.compress=false
4056 # Space-separated list of extra javac options 4058 # Space-separated list of extra javac options
4057 javac.compilerargs= 4059 javac.compilerargs=-XDignore.symbol.file
4058 javac.deprecation=false 4060 javac.deprecation=false
4059 javac.source=""" + str(p.javaCompliance) + """ 4061 javac.source=""" + str(p.javaCompliance) + """
4060 javac.target=""" + str(p.javaCompliance) + """ 4062 javac.target=""" + str(p.javaCompliance) + """
4061 javac.test.classpath=\\ 4063 javac.test.classpath=\\
4062 ${javac.classpath}:\\ 4064 ${javac.classpath}:\\
4152 out.close() 4154 out.close()
4153 files.append(join(p.dir, 'nbproject', 'project.properties')) 4155 files.append(join(p.dir, 'nbproject', 'project.properties'))
4154 4156
4155 if updated: 4157 if updated:
4156 log('If using NetBeans:') 4158 log('If using NetBeans:')
4157 log(' 1. Ensure that the following platform(s) are defined (Tools -> Java Platforms):') 4159 # http://stackoverflow.com/questions/24720665/cant-resolve-jdk-internal-package
4160 log(' 1. Edit etc/netbeans.conf in your NetBeans installation and modify netbeans_default_options variable to include "-J-DCachingArchiveProvider.disableCtSym=true"')
4161 log(' 2. Ensure that the following platform(s) are defined (Tools -> Java Platforms):')
4158 for jdk in jdks: 4162 for jdk in jdks:
4159 log(' JDK_' + str(jdk.version)) 4163 log(' JDK_' + str(jdk.version))
4160 log(' 2. Open/create a Project Group for the directory containing the projects (File -> Project Group -> New Group... -> Folder of Projects)') 4164 log(' 3. Open/create a Project Group for the directory containing the projects (File -> Project Group -> New Group... -> Folder of Projects)')
4161 4165
4162 _zip_files(files, suite.dir, configZip.path) 4166 _zip_files(files, suite.dir, configZip.path)
4163 _zip_files(libFiles, suite.dir, configLibsZip) 4167 _zip_files(libFiles, suite.dir, configLibsZip)
4164 4168
4165 def intellijinit(args, refreshOnly=False): 4169 def intellijinit(args, refreshOnly=False):