def netbeansinit(args, refreshOnly=False, buildProcessorJars=True, doFsckProjects=True): """(re)generate NetBeans project configurations""" jdks = set() for suite in mx.suites(True) + [mx._mx_suite]: _netbeansinit_suite(args, jdks, suite, refreshOnly, buildProcessorJars) if doFsckProjects and not refreshOnly: mx_ideconfig.fsckprojects([]) mx.log('If using NetBeans:') # http://stackoverflow.com/questions/24720665/cant-resolve-jdk-internal-package mx.log( ' 1. Edit etc/netbeans.conf in your NetBeans installation and modify netbeans_default_options variable to include "-J-DCachingArchiveProvider.disableCtSym=true"' ) mx.log( ' 2. Ensure that the following platform(s) are defined (Tools -> Java Platforms):' ) for jdk in jdks: mx.log(' JDK_' + str(jdk.version)) mx.log( ' 3. Open/create a Project Group for the directory containing the projects (File -> Project Group -> New Group... -> Folder of Projects)' )
def netbeansinit(args, refreshOnly=False, buildProcessorJars=True, doFsckProjects=True): """(re)generate NetBeans project configurations""" for suite in mx.suites(True) + [mx._mx_suite]: _netbeansinit_suite(args, suite, refreshOnly, buildProcessorJars) if doFsckProjects and not refreshOnly: mx_ideconfig.fsckprojects([])
def intellijinit(args, refreshOnly=False, doFsckProjects=True, mx_python_modules=True, java_modules=True, generate_external_projects=True, native_projects=False): # In a multiple suite context, the .idea directory in each suite # has to be complete and contain information that is repeated # in dependent suites. declared_modules = set() referenced_modules = set() sdks = intellij_read_sdks() for suite in mx.suites(True) + ([mx._mx_suite] if mx_python_modules else []): _intellij_suite(args, suite, declared_modules, referenced_modules, sdks, refreshOnly, mx_python_modules, generate_external_projects, java_modules and not suite.isBinarySuite(), suite != mx.primary_suite(), generate_native_projects=native_projects) if len(referenced_modules - declared_modules) != 0: mx.abort('Some referenced modules are missing from modules.xml: {}'.format(referenced_modules - declared_modules)) if mx_python_modules: # mx module moduleXml = mx.XMLDoc() moduleXml.open('module', attributes={'type': 'PYTHON_MODULE', 'version': '4'}) moduleXml.open('component', attributes={'name': 'NewModuleRootManager', 'inherit-compiler-output': 'true'}) moduleXml.element('exclude-output') moduleXml.open('content', attributes={'url': 'file://$MODULE_DIR$'}) moduleXml.element('sourceFolder', attributes={'url': 'file://$MODULE_DIR$', 'isTestSource': 'false'}) for d in set((p.subDir for p in mx._mx_suite.projects if p.subDir)): moduleXml.element('excludeFolder', attributes={'url': 'file://$MODULE_DIR$/' + d}) if dirname(mx._mx_suite.get_output_root()) == mx._mx_suite.dir: moduleXml.element('excludeFolder', attributes={'url': 'file://$MODULE_DIR$/' + basename(mx._mx_suite.get_output_root())}) moduleXml.close('content') moduleXml.element('orderEntry', attributes={'type': 'jdk', 'jdkType': intellij_python_sdk_type, 'jdkName': intellij_get_python_sdk_name(sdks)}) moduleXml.element('orderEntry', attributes={'type': 'sourceFolder', 'forTests': 'false'}) moduleXml.close('component') moduleXml.close('module') mxModuleFile = join(mx._mx_suite.dir, basename(mx._mx_suite.dir) + '.iml') mx.update_file(mxModuleFile, moduleXml.xml(indent=' ', newl='\n')) if doFsckProjects and not refreshOnly: mx_ideconfig.fsckprojects([])