• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2#
3# Copyright 2020 - The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16"""The iml/xml templates of AIDEgen."""
17
18
19
20# Content of iml file.
21FILE_IML = """\
22<?xml version="1.0" encoding="UTF-8"?>
23<module type="JAVA_MODULE" version="4">
24@FACETS@
25    <component name="NewModuleRootManager" inherit-compiler-output="true">
26        <exclude-output />
27@SOURCES@
28@SRCJAR@
29        <orderEntry type="sourceFolder" forTests="false" />
30@MODULE_DEPENDENCIES@
31        <orderEntry type="inheritedJdk" />
32    </component>
33</module>
34"""
35# TODO(b/153704028): Refactor to create iml file.
36IML = """\
37<?xml version="1.0" encoding="UTF-8"?>
38<module type="JAVA_MODULE" version="4">{FACET}
39    <component name="NewModuleRootManager" inherit-compiler-output="true">
40        <exclude-output />{SOURCES}
41        <orderEntry type="sourceFolder" forTests="false" />{SRCJARS}{DEPENDENCIES}{JARS}
42        <orderEntry type="inheritedJdk" />
43    </component>
44</module>
45"""
46FACET = """
47    <facet type="android" name="Android">
48        <configuration />
49    </facet>"""
50CONTENT = """
51        <content url="file://{MODULE_PATH}">{EXCLUDES}{SOURCES}
52        </content>"""
53SOURCE = """
54            <sourceFolder url="file://{SRC}" isTestSource="{IS_TEST}" />"""
55OTHER_SOURCE = """
56        <content url="file://{SRC}">
57            <sourceFolder url="file://{SRC}" isTestSource="{IS_TEST}" />
58        </content>"""
59SRCJAR = """
60        <content url="jar://{SRCJAR}!/">
61            <sourceFolder url="jar://{SRCJAR}!/" isTestSource="False" />
62        </content>"""
63JAR = """
64        <orderEntry type="module-library" exported="">
65          <library>
66            <CLASSES>
67              <root url="jar://{JAR}!/" />
68            </CLASSES>
69            <JAVADOC />
70            <SOURCES />
71          </library>
72        </orderEntry>"""
73DEPENDENCIES = """
74        <orderEntry type="module" module-name="{MODULE}" />"""
75
76# The template content of modules.xml.
77XML_MODULES = """\
78<?xml version="1.0" encoding="UTF-8"?>
79<project version="4">
80    <component name="ProjectModuleManager">
81        <modules>
82@MODULES@
83@ENABLE_DEBUGGER_MODULE@
84        </modules>
85    </component>
86</project>
87"""
88
89# The template content of vcs.xml.
90XML_VCS = """\
91<?xml version="1.0" encoding="UTF-8"?>
92<project version="4">
93    <component name="VcsDirectoryMappings">
94{GIT_MAPPINGS}
95    </component>
96</project>
97"""
98
99# The template content of misc.xml
100XML_MISC = """\
101<?xml version="1.0" encoding="UTF-8"?>
102<project version="4">
103    <component name="ConfigCheckProjectState">
104        <option name="disabledCheckers">
105            <list>
106                <option value="com.google.devtools.intellig.configcheck.JavacHeapChecker"/>
107                <option value="com.google.devtools.intellig.configcheck.VcsMappingsChecker"/>
108            </list>
109        </option>
110    </component>
111    <component name="FrameworkDetectionExcludesConfiguration">
112        <type id="android" />
113    </component>
114    <component name="ContinuousBuildConfigurationComponent">
115        <builds>
116            <build intervalToCheckBuild="1" buildKey="" buildLabel=""
117                   enabled="false" tapBuild="false"/>
118        </builds>
119    </component>
120    <component name="DependencyValidationManager">
121        <option name="SKIP_IMPORT_STATEMENTS" value="false"/>
122    </component>
123    <component name="EntryPointsManager">
124        <entry_points version="2.0"/>
125    </component>
126    <component name="JavadocGenerationManager">
127        <option name="HEAP_SIZE"/>
128        <option name="LOCALE"/>
129        <option name="OPEN_IN_BROWSER" value="true"/>
130        <option name="OPTION_DEPRECATED_LIST" value="true"/>
131        <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false"/>
132        <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true"/>
133        <option name="OPTION_DOCUMENT_TAG_USE" value="false"/>
134        <option name="OPTION_DOCUMENT_TAG_VERSION" value="false"/>
135        <option name="OPTION_HIERARCHY" value="true"/>
136        <option name="OPTION_INDEX" value="true"/>
137        <option name="OPTION_NAVIGATOR" value="true"/>
138        <option name="OPTION_SCOPE" value="protected"/>
139        <option name="OPTION_SEPARATE_INDEX" value="true"/>
140        <option name="OTHER_OPTIONS" value=""/>
141        <option name="OUTPUT_DIRECTORY"/>
142    </component>
143    <component name="Mach LOCAL_PREFIX stripper" stripping="true"/>
144    <component name="ProjectResources">
145        <default-html-doctype>http://www.w3.org/1999/xhtml
146        </default-html-doctype>
147    </component>
148    <component name="ProjectRootManager" version="2" languageLevel="JDK_17"
149               assert-keyword="true" project-jdk-name="JDK17"
150               project-jdk-type="JavaSDK"/>
151    <component name="WebServicesPlugin" addRequiredLibraries="true"/>
152</project>
153"""
154
155# The template content of compiler.xml
156XML_COMPILER = """\
157<?xml version="1.0" encoding="UTF-8"?>
158<project version="4">
159    <component name="CompilerConfiguration">
160        <option name="DEFAULT_COMPILER" value="Javac"/>
161        <resourceExtensions/>
162        <wildcardResourcePatterns>
163            <entry name="?*.dtd"/>
164            <entry name="?*.ftl"/>
165            <entry name="?*.gif"/>
166            <entry name="?*.html"/>
167            <entry name="?*.jpeg"/>
168            <entry name="?*.jpg"/>
169            <entry name="?*.png"/>
170            <entry name="?*.properties"/>
171            <entry name="?*.tld"/>
172            <entry name="?*.xml"/>
173        </wildcardResourcePatterns>
174        <annotationProcessing enabled="false" useClasspath="true"/>
175    </component>
176    <component name="JavacSettings">
177        <option name="MAXIMUM_HEAP_SIZE" value="1024"/>
178    </component>
179</project>
180"""
181
182# The template content of codeStyleConfig.xml
183XML_CODE_STYLE_CONFIG = """\
184<component name="ProjectCodeStyleConfiguration">
185  <state>
186    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
187  </state>
188</component>
189"""
190
191# The template content of Apache_2.xml
192XML_APACHE_2 = """\
193<component name="CopyrightManager">
194    <copyright>
195        <option name="notice"
196                value="Copyright (C) &amp;#36;today.year The Android Open Source Project&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10;     http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License."/>
197        <option name="keyword" value="Copyright"/>
198        <option name="allowReplaceKeyword" value=""/>
199        <option name="myName" value="Apache 2"/>
200        <option name="myLocal" value="true"/>
201    </copyright>
202</component>
203"""
204
205# The template content of copyright/profiles_settings.xml
206XML_COPYRIGHT_PROFILES_SETTINGS = """\
207<component name="CopyrightManager">
208    <settings default="">
209        <module2copyright>
210            <element module="Project Files" copyright="Apache 2"/>
211        </module2copyright>
212    </settings>
213</component>
214"""
215
216# The template content of inspectionProfiles/profiles_settings.xml
217XML_INSPECTION_PROFILES_SETTINGS = """\
218<component name="InspectionProjectProfileManager">
219  <settings>
220    <option name="PROJECT_PROFILE" value="Aidegen_Inspections" />
221    <version value="1.0" />
222  </settings>
223</component>
224"""
225
226# The template content of inspectionProfiles/Aidegen_Inspections.xml
227# N.b. this minimal configuration leaves most of the options unspecified,
228# which means that they will be filled with default values set by Jetbrains.
229XML_INSPECTIONS = """\
230<component name="InspectionProjectProfileManager">
231  <profile version="1.0">
232    <option name="myName" value="Aidegen_Inspections" />
233    <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
234      <option name="myAdditionalJavadocTags" value="hide,attr" />
235    </inspection_tool>
236    <inspection_tool class="MissortedModifiers" enabled="true" level="WARNING" enabled_by_default="true">
237      <option name="m_requireAnnotationsFirst" value="true" />
238    </inspection_tool>
239  </profile>
240</component>
241"""
242
243# The configuration of JDK on Linux.
244LINUX_JDK_XML = """\
245    <jdk version="2">
246      <name value="JDK17" />
247      <type value="JavaSDK" />
248      <version value="java version &quot;17.0.4&quot;" />
249      <homePath value="{JDKpath}" />
250      <roots>
251        <annotationsPath>
252          <root type="composite">
253            <root url="jar://$APPLICATION_HOME_DIR$/plugins/java/lib/jdkAnnotations.jar!/" type="simple" />
254          </root>
255        </annotationsPath>
256        <classPath>
257          <root type="composite">
258            <root url="jrt://{JDKpath}!/java.base" type="simple" />
259            <root url="jrt://{JDKpath}!/java.compiler" type="simple" />
260            <root url="jrt://{JDKpath}!/java.datatransfer" type="simple" />
261            <root url="jrt://{JDKpath}!/java.desktop" type="simple" />
262            <root url="jrt://{JDKpath}!/java.instrument" type="simple" />
263            <root url="jrt://{JDKpath}!/java.logging" type="simple" />
264            <root url="jrt://{JDKpath}!/java.management" type="simple" />
265            <root url="jrt://{JDKpath}!/java.management.rmi" type="simple" />
266            <root url="jrt://{JDKpath}!/java.naming" type="simple" />
267            <root url="jrt://{JDKpath}!/java.net.http" type="simple" />
268            <root url="jrt://{JDKpath}!/java.prefs" type="simple" />
269            <root url="jrt://{JDKpath}!/java.rmi" type="simple" />
270            <root url="jrt://{JDKpath}!/java.scripting" type="simple" />
271            <root url="jrt://{JDKpath}!/java.se" type="simple" />
272            <root url="jrt://{JDKpath}!/java.security.jgss" type="simple" />
273            <root url="jrt://{JDKpath}!/java.security.sasl" type="simple" />
274            <root url="jrt://{JDKpath}!/java.smartcardio" type="simple" />
275            <root url="jrt://{JDKpath}!/java.sql" type="simple" />
276            <root url="jrt://{JDKpath}!/java.sql.rowset" type="simple" />
277            <root url="jrt://{JDKpath}!/java.transaction.xa" type="simple" />
278            <root url="jrt://{JDKpath}!/java.xml" type="simple" />
279            <root url="jrt://{JDKpath}!/java.xml.crypto" type="simple" />
280            <root url="jrt://{JDKpath}!/jdk.accessibility" type="simple" />
281            <root url="jrt://{JDKpath}!/jdk.attach" type="simple" />
282            <root url="jrt://{JDKpath}!/jdk.charsets" type="simple" />
283            <root url="jrt://{JDKpath}!/jdk.compiler" type="simple" />
284            <root url="jrt://{JDKpath}!/jdk.crypto.cryptoki" type="simple" />
285            <root url="jrt://{JDKpath}!/jdk.crypto.ec" type="simple" />
286            <root url="jrt://{JDKpath}!/jdk.dynalink" type="simple" />
287            <root url="jrt://{JDKpath}!/jdk.editpad" type="simple" />
288            <root url="jrt://{JDKpath}!/jdk.hotspot.agent" type="simple" />
289            <root url="jrt://{JDKpath}!/jdk.httpserver" type="simple" />
290            <root url="jrt://{JDKpath}!/jdk.incubator.foreign" type="simple" />
291            <root url="jrt://{JDKpath}!/jdk.incubator.vector" type="simple" />
292            <root url="jrt://{JDKpath}!/jdk.internal.ed" type="simple" />
293            <root url="jrt://{JDKpath}!/jdk.internal.jvmstat" type="simple" />
294            <root url="jrt://{JDKpath}!/jdk.internal.le" type="simple" />
295            <root url="jrt://{JDKpath}!/jdk.internal.opt" type="simple" />
296            <root url="jrt://{JDKpath}!/jdk.internal.vm.ci" type="simple" />
297            <root url="jrt://{JDKpath}!/jdk.internal.vm.compiler" type="simple" />
298            <root url="jrt://{JDKpath}!/jdk.internal.vm.compiler.management" type="simple" />
299            <root url="jrt://{JDKpath}!/jdk.jartool" type="simple" />
300            <root url="jrt://{JDKpath}!/jdk.javadoc" type="simple" />
301            <root url="jrt://{JDKpath}!/jdk.jcmd" type="simple" />
302            <root url="jrt://{JDKpath}!/jdk.jconsole" type="simple" />
303            <root url="jrt://{JDKpath}!/jdk.jdeps" type="simple" />
304            <root url="jrt://{JDKpath}!/jdk.jdi" type="simple" />
305            <root url="jrt://{JDKpath}!/jdk.jdwp.agent" type="simple" />
306            <root url="jrt://{JDKpath}!/jdk.jfr" type="simple" />
307            <root url="jrt://{JDKpath}!/jdk.jlink" type="simple" />
308            <root url="jrt://{JDKpath}!/jdk.jpackage" type="simple" />
309            <root url="jrt://{JDKpath}!/jdk.jshell" type="simple" />
310            <root url="jrt://{JDKpath}!/jdk.jsobject" type="simple" />
311            <root url="jrt://{JDKpath}!/jdk.jstatd" type="simple" />
312            <root url="jrt://{JDKpath}!/jdk.localedata" type="simple" />
313            <root url="jrt://{JDKpath}!/jdk.management" type="simple" />
314            <root url="jrt://{JDKpath}!/jdk.management.agent" type="simple" />
315            <root url="jrt://{JDKpath}!/jdk.management.jfr" type="simple" />
316            <root url="jrt://{JDKpath}!/jdk.naming.dns" type="simple" />
317            <root url="jrt://{JDKpath}!/jdk.naming.rmi" type="simple" />
318            <root url="jrt://{JDKpath}!/jdk.net" type="simple" />
319            <root url="jrt://{JDKpath}!/jdk.nio.mapmode" type="simple" />
320            <root url="jrt://{JDKpath}!/jdk.random" type="simple" />
321            <root url="jrt://{JDKpath}!/jdk.sctp" type="simple" />
322            <root url="jrt://{JDKpath}!/jdk.security.auth" type="simple" />
323            <root url="jrt://{JDKpath}!/jdk.security.jgss" type="simple" />
324            <root url="jrt://{JDKpath}!/jdk.unsupported" type="simple" />
325            <root url="jrt://{JDKpath}!/jdk.unsupported.desktop" type="simple" />
326            <root url="jrt://{JDKpath}!/jdk.xml.dom" type="simple" />
327            <root url="jrt://{JDKpath}!/jdk.zipfs" type="simple" />
328          </root>
329        </classPath>
330        <javadocPath>
331          <root type="composite" />
332        </javadocPath>
333        <sourcePath>
334          <root type="composite">
335            <root url="jar://{JDKpath}/lib/src.zip!/java.se" type="simple" />
336            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jdi" type="simple" />
337            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jfr" type="simple" />
338            <root url="jar://{JDKpath}/lib/src.zip!/jdk.net" type="simple" />
339            <root url="jar://{JDKpath}/lib/src.zip!/java.rmi" type="simple" />
340            <root url="jar://{JDKpath}/lib/src.zip!/java.sql" type="simple" />
341            <root url="jar://{JDKpath}/lib/src.zip!/java.xml" type="simple" />
342            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jcmd" type="simple" />
343            <root url="jar://{JDKpath}/lib/src.zip!/jdk.sctp" type="simple" />
344            <root url="jar://{JDKpath}/lib/src.zip!/java.base" type="simple" />
345            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jdeps" type="simple" />
346            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jlink" type="simple" />
347            <root url="jar://{JDKpath}/lib/src.zip!/jdk.zipfs" type="simple" />
348            <root url="jar://{JDKpath}/lib/src.zip!/java.prefs" type="simple" />
349            <root url="jar://{JDKpath}/lib/src.zip!/jdk.attach" type="simple" />
350            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jshell" type="simple" />
351            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jstatd" type="simple" />
352            <root url="jar://{JDKpath}/lib/src.zip!/jdk.random" type="simple" />
353            <root url="jar://{JDKpath}/lib/src.zip!/java.naming" type="simple" />
354            <root url="jar://{JDKpath}/lib/src.zip!/jdk.editpad" type="simple" />
355            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jartool" type="simple" />
356            <root url="jar://{JDKpath}/lib/src.zip!/jdk.javadoc" type="simple" />
357            <root url="jar://{JDKpath}/lib/src.zip!/jdk.xml.dom" type="simple" />
358            <root url="jar://{JDKpath}/lib/src.zip!/java.desktop" type="simple" />
359            <root url="jar://{JDKpath}/lib/src.zip!/java.logging" type="simple" />
360            <root url="jar://{JDKpath}/lib/src.zip!/jdk.charsets" type="simple" />
361            <root url="jar://{JDKpath}/lib/src.zip!/jdk.compiler" type="simple" />
362            <root url="jar://{JDKpath}/lib/src.zip!/jdk.dynalink" type="simple" />
363            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jconsole" type="simple" />
364            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jpackage" type="simple" />
365            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jsobject" type="simple" />
366            <root url="jar://{JDKpath}/lib/src.zip!/java.compiler" type="simple" />
367            <root url="jar://{JDKpath}/lib/src.zip!/java.net.http" type="simple" />
368            <root url="jar://{JDKpath}/lib/src.zip!/jdk.crypto.ec" type="simple" />
369            <root url="jar://{JDKpath}/lib/src.zip!/java.scripting" type="simple" />
370            <root url="jar://{JDKpath}/lib/src.zip!/jdk.httpserver" type="simple" />
371            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jdwp.agent" type="simple" />
372            <root url="jar://{JDKpath}/lib/src.zip!/jdk.localedata" type="simple" />
373            <root url="jar://{JDKpath}/lib/src.zip!/jdk.management" type="simple" />
374            <root url="jar://{JDKpath}/lib/src.zip!/jdk.naming.dns" type="simple" />
375            <root url="jar://{JDKpath}/lib/src.zip!/jdk.naming.rmi" type="simple" />
376            <root url="jar://{JDKpath}/lib/src.zip!/java.instrument" type="simple" />
377            <root url="jar://{JDKpath}/lib/src.zip!/java.management" type="simple" />
378            <root url="jar://{JDKpath}/lib/src.zip!/java.sql.rowset" type="simple" />
379            <root url="jar://{JDKpath}/lib/src.zip!/java.xml.crypto" type="simple" />
380            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.ed" type="simple" />
381            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.le" type="simple" />
382            <root url="jar://{JDKpath}/lib/src.zip!/jdk.nio.mapmode" type="simple" />
383            <root url="jar://{JDKpath}/lib/src.zip!/jdk.unsupported" type="simple" />
384            <root url="jar://{JDKpath}/lib/src.zip!/java.smartcardio" type="simple" />
385            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.opt" type="simple" />
386            <root url="jar://{JDKpath}/lib/src.zip!/java.datatransfer" type="simple" />
387            <root url="jar://{JDKpath}/lib/src.zip!/jdk.accessibility" type="simple" />
388            <root url="jar://{JDKpath}/lib/src.zip!/jdk.hotspot.agent" type="simple" />
389            <root url="jar://{JDKpath}/lib/src.zip!/jdk.security.auth" type="simple" />
390            <root url="jar://{JDKpath}/lib/src.zip!/jdk.security.jgss" type="simple" />
391            <root url="jar://{JDKpath}/lib/src.zip!/java.security.jgss" type="simple" />
392            <root url="jar://{JDKpath}/lib/src.zip!/java.security.sasl" type="simple" />
393            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.vm.ci" type="simple" />
394            <root url="jar://{JDKpath}/lib/src.zip!/jdk.management.jfr" type="simple" />
395            <root url="jar://{JDKpath}/lib/src.zip!/java.management.rmi" type="simple" />
396            <root url="jar://{JDKpath}/lib/src.zip!/java.transaction.xa" type="simple" />
397            <root url="jar://{JDKpath}/lib/src.zip!/jdk.crypto.cryptoki" type="simple" />
398            <root url="jar://{JDKpath}/lib/src.zip!/jdk.incubator.vector" type="simple" />
399            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.jvmstat" type="simple" />
400            <root url="jar://{JDKpath}/lib/src.zip!/jdk.management.agent" type="simple" />
401            <root url="jar://{JDKpath}/lib/src.zip!/jdk.incubator.foreign" type="simple" />
402            <root url="jar://{JDKpath}/lib/src.zip!/jdk.unsupported.desktop" type="simple" />
403            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.vm.compiler" type="simple" />
404            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.vm.compiler.management" type="simple" />
405          </root>
406        </sourcePath>
407      </roots>
408      <additional />
409    </jdk>
410"""
411
412# The configuration of JDK on Mac.
413MAC_JDK_XML = """\
414    <jdk version="2">
415      <name value="JDK17" />
416      <type value="JavaSDK" />
417      <version value="java version &quot;17.0.4&quot;" />
418      <homePath value="{JDKpath}" />
419      <roots>
420        <annotationsPath>
421          <root type="composite">
422            <root url="jar://$APPLICATION_HOME_DIR$/plugins/java/lib/jdkAnnotations.jar!/" type="simple" />
423          </root>
424        </annotationsPath>
425        <classPath>
426          <root type="composite">
427            <root url="jrt://{JDKpath}!/java.base" type="simple" />
428            <root url="jrt://{JDKpath}!/java.compiler" type="simple" />
429            <root url="jrt://{JDKpath}!/java.datatransfer" type="simple" />
430            <root url="jrt://{JDKpath}!/java.desktop" type="simple" />
431            <root url="jrt://{JDKpath}!/java.instrument" type="simple" />
432            <root url="jrt://{JDKpath}!/java.logging" type="simple" />
433            <root url="jrt://{JDKpath}!/java.management" type="simple" />
434            <root url="jrt://{JDKpath}!/java.management.rmi" type="simple" />
435            <root url="jrt://{JDKpath}!/java.naming" type="simple" />
436            <root url="jrt://{JDKpath}!/java.net.http" type="simple" />
437            <root url="jrt://{JDKpath}!/java.prefs" type="simple" />
438            <root url="jrt://{JDKpath}!/java.rmi" type="simple" />
439            <root url="jrt://{JDKpath}!/java.scripting" type="simple" />
440            <root url="jrt://{JDKpath}!/java.se" type="simple" />
441            <root url="jrt://{JDKpath}!/java.security.jgss" type="simple" />
442            <root url="jrt://{JDKpath}!/java.security.sasl" type="simple" />
443            <root url="jrt://{JDKpath}!/java.smartcardio" type="simple" />
444            <root url="jrt://{JDKpath}!/java.sql" type="simple" />
445            <root url="jrt://{JDKpath}!/java.sql.rowset" type="simple" />
446            <root url="jrt://{JDKpath}!/java.transaction.xa" type="simple" />
447            <root url="jrt://{JDKpath}!/java.xml" type="simple" />
448            <root url="jrt://{JDKpath}!/java.xml.crypto" type="simple" />
449            <root url="jrt://{JDKpath}!/jdk.accessibility" type="simple" />
450            <root url="jrt://{JDKpath}!/jdk.attach" type="simple" />
451            <root url="jrt://{JDKpath}!/jdk.charsets" type="simple" />
452            <root url="jrt://{JDKpath}!/jdk.compiler" type="simple" />
453            <root url="jrt://{JDKpath}!/jdk.crypto.cryptoki" type="simple" />
454            <root url="jrt://{JDKpath}!/jdk.crypto.ec" type="simple" />
455            <root url="jrt://{JDKpath}!/jdk.dynalink" type="simple" />
456            <root url="jrt://{JDKpath}!/jdk.editpad" type="simple" />
457            <root url="jrt://{JDKpath}!/jdk.hotspot.agent" type="simple" />
458            <root url="jrt://{JDKpath}!/jdk.httpserver" type="simple" />
459            <root url="jrt://{JDKpath}!/jdk.incubator.foreign" type="simple" />
460            <root url="jrt://{JDKpath}!/jdk.incubator.vector" type="simple" />
461            <root url="jrt://{JDKpath}!/jdk.internal.ed" type="simple" />
462            <root url="jrt://{JDKpath}!/jdk.internal.jvmstat" type="simple" />
463            <root url="jrt://{JDKpath}!/jdk.internal.le" type="simple" />
464            <root url="jrt://{JDKpath}!/jdk.internal.opt" type="simple" />
465            <root url="jrt://{JDKpath}!/jdk.internal.vm.ci" type="simple" />
466            <root url="jrt://{JDKpath}!/jdk.internal.vm.compiler" type="simple" />
467            <root url="jrt://{JDKpath}!/jdk.internal.vm.compiler.management" type="simple" />
468            <root url="jrt://{JDKpath}!/jdk.jartool" type="simple" />
469            <root url="jrt://{JDKpath}!/jdk.javadoc" type="simple" />
470            <root url="jrt://{JDKpath}!/jdk.jcmd" type="simple" />
471            <root url="jrt://{JDKpath}!/jdk.jconsole" type="simple" />
472            <root url="jrt://{JDKpath}!/jdk.jdeps" type="simple" />
473            <root url="jrt://{JDKpath}!/jdk.jdi" type="simple" />
474            <root url="jrt://{JDKpath}!/jdk.jdwp.agent" type="simple" />
475            <root url="jrt://{JDKpath}!/jdk.jfr" type="simple" />
476            <root url="jrt://{JDKpath}!/jdk.jlink" type="simple" />
477            <root url="jrt://{JDKpath}!/jdk.jpackage" type="simple" />
478            <root url="jrt://{JDKpath}!/jdk.jshell" type="simple" />
479            <root url="jrt://{JDKpath}!/jdk.jsobject" type="simple" />
480            <root url="jrt://{JDKpath}!/jdk.jstatd" type="simple" />
481            <root url="jrt://{JDKpath}!/jdk.localedata" type="simple" />
482            <root url="jrt://{JDKpath}!/jdk.management" type="simple" />
483            <root url="jrt://{JDKpath}!/jdk.management.agent" type="simple" />
484            <root url="jrt://{JDKpath}!/jdk.management.jfr" type="simple" />
485            <root url="jrt://{JDKpath}!/jdk.naming.dns" type="simple" />
486            <root url="jrt://{JDKpath}!/jdk.naming.rmi" type="simple" />
487            <root url="jrt://{JDKpath}!/jdk.net" type="simple" />
488            <root url="jrt://{JDKpath}!/jdk.nio.mapmode" type="simple" />
489            <root url="jrt://{JDKpath}!/jdk.random" type="simple" />
490            <root url="jrt://{JDKpath}!/jdk.sctp" type="simple" />
491            <root url="jrt://{JDKpath}!/jdk.security.auth" type="simple" />
492            <root url="jrt://{JDKpath}!/jdk.security.jgss" type="simple" />
493            <root url="jrt://{JDKpath}!/jdk.unsupported" type="simple" />
494            <root url="jrt://{JDKpath}!/jdk.unsupported.desktop" type="simple" />
495            <root url="jrt://{JDKpath}!/jdk.xml.dom" type="simple" />
496            <root url="jrt://{JDKpath}!/jdk.zipfs" type="simple" />
497          </root>
498        </classPath>
499        <javadocPath>
500          <root type="composite" />
501        </javadocPath>
502        <sourcePath>
503          <root type="composite">
504            <root url="jar://{JDKpath}/lib/src.zip!/java.se" type="simple" />
505            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jdi" type="simple" />
506            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jfr" type="simple" />
507            <root url="jar://{JDKpath}/lib/src.zip!/jdk.net" type="simple" />
508            <root url="jar://{JDKpath}/lib/src.zip!/java.rmi" type="simple" />
509            <root url="jar://{JDKpath}/lib/src.zip!/java.sql" type="simple" />
510            <root url="jar://{JDKpath}/lib/src.zip!/java.xml" type="simple" />
511            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jcmd" type="simple" />
512            <root url="jar://{JDKpath}/lib/src.zip!/jdk.sctp" type="simple" />
513            <root url="jar://{JDKpath}/lib/src.zip!/java.base" type="simple" />
514            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jdeps" type="simple" />
515            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jlink" type="simple" />
516            <root url="jar://{JDKpath}/lib/src.zip!/jdk.zipfs" type="simple" />
517            <root url="jar://{JDKpath}/lib/src.zip!/java.prefs" type="simple" />
518            <root url="jar://{JDKpath}/lib/src.zip!/jdk.attach" type="simple" />
519            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jshell" type="simple" />
520            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jstatd" type="simple" />
521            <root url="jar://{JDKpath}/lib/src.zip!/jdk.random" type="simple" />
522            <root url="jar://{JDKpath}/lib/src.zip!/java.naming" type="simple" />
523            <root url="jar://{JDKpath}/lib/src.zip!/jdk.editpad" type="simple" />
524            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jartool" type="simple" />
525            <root url="jar://{JDKpath}/lib/src.zip!/jdk.javadoc" type="simple" />
526            <root url="jar://{JDKpath}/lib/src.zip!/jdk.xml.dom" type="simple" />
527            <root url="jar://{JDKpath}/lib/src.zip!/java.desktop" type="simple" />
528            <root url="jar://{JDKpath}/lib/src.zip!/java.logging" type="simple" />
529            <root url="jar://{JDKpath}/lib/src.zip!/jdk.charsets" type="simple" />
530            <root url="jar://{JDKpath}/lib/src.zip!/jdk.compiler" type="simple" />
531            <root url="jar://{JDKpath}/lib/src.zip!/jdk.dynalink" type="simple" />
532            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jconsole" type="simple" />
533            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jpackage" type="simple" />
534            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jsobject" type="simple" />
535            <root url="jar://{JDKpath}/lib/src.zip!/java.compiler" type="simple" />
536            <root url="jar://{JDKpath}/lib/src.zip!/java.net.http" type="simple" />
537            <root url="jar://{JDKpath}/lib/src.zip!/jdk.crypto.ec" type="simple" />
538            <root url="jar://{JDKpath}/lib/src.zip!/java.scripting" type="simple" />
539            <root url="jar://{JDKpath}/lib/src.zip!/jdk.httpserver" type="simple" />
540            <root url="jar://{JDKpath}/lib/src.zip!/jdk.jdwp.agent" type="simple" />
541            <root url="jar://{JDKpath}/lib/src.zip!/jdk.localedata" type="simple" />
542            <root url="jar://{JDKpath}/lib/src.zip!/jdk.management" type="simple" />
543            <root url="jar://{JDKpath}/lib/src.zip!/jdk.naming.dns" type="simple" />
544            <root url="jar://{JDKpath}/lib/src.zip!/jdk.naming.rmi" type="simple" />
545            <root url="jar://{JDKpath}/lib/src.zip!/java.instrument" type="simple" />
546            <root url="jar://{JDKpath}/lib/src.zip!/java.management" type="simple" />
547            <root url="jar://{JDKpath}/lib/src.zip!/java.sql.rowset" type="simple" />
548            <root url="jar://{JDKpath}/lib/src.zip!/java.xml.crypto" type="simple" />
549            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.ed" type="simple" />
550            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.le" type="simple" />
551            <root url="jar://{JDKpath}/lib/src.zip!/jdk.nio.mapmode" type="simple" />
552            <root url="jar://{JDKpath}/lib/src.zip!/jdk.unsupported" type="simple" />
553            <root url="jar://{JDKpath}/lib/src.zip!/java.smartcardio" type="simple" />
554            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.opt" type="simple" />
555            <root url="jar://{JDKpath}/lib/src.zip!/java.datatransfer" type="simple" />
556            <root url="jar://{JDKpath}/lib/src.zip!/jdk.accessibility" type="simple" />
557            <root url="jar://{JDKpath}/lib/src.zip!/jdk.hotspot.agent" type="simple" />
558            <root url="jar://{JDKpath}/lib/src.zip!/jdk.security.auth" type="simple" />
559            <root url="jar://{JDKpath}/lib/src.zip!/jdk.security.jgss" type="simple" />
560            <root url="jar://{JDKpath}/lib/src.zip!/java.security.jgss" type="simple" />
561            <root url="jar://{JDKpath}/lib/src.zip!/java.security.sasl" type="simple" />
562            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.vm.ci" type="simple" />
563            <root url="jar://{JDKpath}/lib/src.zip!/jdk.management.jfr" type="simple" />
564            <root url="jar://{JDKpath}/lib/src.zip!/java.management.rmi" type="simple" />
565            <root url="jar://{JDKpath}/lib/src.zip!/java.transaction.xa" type="simple" />
566            <root url="jar://{JDKpath}/lib/src.zip!/jdk.crypto.cryptoki" type="simple" />
567            <root url="jar://{JDKpath}/lib/src.zip!/jdk.incubator.vector" type="simple" />
568            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.jvmstat" type="simple" />
569            <root url="jar://{JDKpath}/lib/src.zip!/jdk.management.agent" type="simple" />
570            <root url="jar://{JDKpath}/lib/src.zip!/jdk.incubator.foreign" type="simple" />
571            <root url="jar://{JDKpath}/lib/src.zip!/jdk.unsupported.desktop" type="simple" />
572            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.vm.compiler" type="simple" />
573            <root url="jar://{JDKpath}/lib/src.zip!/jdk.internal.vm.compiler.management" type="simple" />
574          </root>
575        </sourcePath>
576      </roots>
577      <additional />
578    </jdk>
579"""
580
581# The file's header of CLion project file.
582CMAKELISTS_HEADER = """\
583# THIS FILE WAS AUTOMATICALLY GENERATED!
584# ANY MODIFICATION WILL BE OVERWRITTEN!
585
586# To improve project view in Clion    :
587# Tools > CMake > Change Project Root
588
589cmake_minimum_required(VERSION @MINVERSION@)
590project(@PROJNAME@)
591set(ANDROID_ROOT @ANDROIDROOT@)
592"""
593
594# The configuration of Android SDK.
595ANDROID_SDK_XML = """\
596    <jdk version="2">
597      <name value="Android API {CODE_NAME} Platform" />
598      <type value="Android SDK" />
599      <version value="java version &quot;17.0.4&quot;" />
600      <homePath value="{ANDROID_SDK_PATH}" />
601      <roots>
602        <annotationsPath>
603          <root type="composite" >
604            <root url="jar://{ANDROID_SDK_PATH}/platforms/{FOLDER_NAME}/data/annotations.zip!/" type="simple" />
605          </root>
606        </annotationsPath>
607        <classPath>
608          <root type="composite">
609            <root url="jar://{ANDROID_SDK_PATH}/platforms/{FOLDER_NAME}/android.jar!/" type="simple" />
610            <root url="file://{ANDROID_SDK_PATH}/platforms/{FOLDER_NAME}/data/res" type="simple" />
611          </root>
612        </classPath>
613        <javadocPath>
614          <root type="composite" >
615            <root url="http://developer.android.com/reference/" type="simple" />
616          </root>
617        </javadocPath>
618        <sourcePath>
619          <root type="composite" />
620        </sourcePath>
621      </roots>
622      <additional jdk="JDK17" sdk="android-{CODE_NAME}" />
623    </jdk>
624"""
625
626# The configuration of TEST_MAPPING in jsonSchemas.xml.
627TEST_MAPPING_SCHEMAS_XML = """\
628<?xml version="1.0" encoding="UTF-8"?>
629<project version="4">
630  <component name="JsonSchemaMappingsProjectConfiguration">
631    <state>
632      <map>
633        <entry key="TEST_MAPPING.config">
634          <value>
635            <SchemaInfo>
636              <option name="name" value="TEST_MAPPING.config" />
637              <option name="relativePathToSchema" value="{SCHEMA_PATH}" />
638              <option name="schemaVersion" value="JSON schema version 7" />
639              <option name="patterns">
640                <list>
641                  <Item>
642                    <option name="path" value="TEST_MAPPING" />
643                  </Item>
644                </list>
645              </option>
646            </SchemaInfo>
647          </value>
648        </entry>
649      </map>
650    </state>
651  </component>
652</project>
653"""
654
655# The xml templates for Eclipse.
656# .classpath template
657ECLIPSE_CLASSPATH_XML = """<\
658?xml version="1.0" encoding="UTF-8"?>
659<classpath>
660{SRC}
661{LIB}
662</classpath>
663"""
664
665# .project template
666ECLIPSE_PROJECT_XML = """\
667<?xml version="1.0" encoding="UTF-8"?>
668<projectDescription>
669        <name>{PROJECTNAME}</name>
670        <comment></comment>
671        <projects>
672        </projects>
673        <buildSpec>
674                <buildCommand>
675                        <name>org.eclipse.jdt.core.javabuilder</name>
676                        <arguments>
677                        </arguments>
678                </buildCommand>
679        </buildSpec>
680        <natures>
681                <nature>org.eclipse.jdt.core.javanature</nature>
682        </natures>
683        <linkedResources>
684{LINKEDRESOURCES}
685        </linkedResources>
686</projectDescription>
687"""
688
689# The template of default AndroidManifest.xml.
690ANDROID_MANIFEST_CONTENT = """\
691<?xml version="1.0" encoding="utf-8"?>
692<manifest xmlns:android="http://schemas.android.com/apk/res/android"
693          android:versionCode="1"
694          android:versionName="1.0" >
695</manifest>
696"""
697
698# The xml template for enabling debugger.
699XML_ENABLE_DEBUGGER = """\
700<?xml version="1.0" encoding="UTF-8"?>
701<module type="JAVA_MODULE" version="4">
702  <component name="FacetManager">
703    <facet type="android" name="Android">
704      <configuration />
705    </facet>
706  </component>
707  <component name="NewModuleRootManager" inherit-compiler-output="true">
708    <exclude-output />
709    <content url="file://$MODULE_DIR$">
710      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
711      <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
712    </content>
713    <orderEntry type="jdk" jdkName="{ANDROID_SDK_VERSION}" jdkType="Android SDK" />
714    <orderEntry type="sourceFolder" forTests="false" />
715  </component>
716</module>
717"""
718
719# The default empty template of the jdk.table.xml.
720JDK_TABLE_XML = """\
721<application>
722  <component name="ProjectJdkTable">
723  </component>
724</application>
725"""
726
727XML_WORKSPACE = """\
728<?xml version="1.0" encoding="UTF-8"?>
729<project version="4">
730    <component name="VcsManagerConfiguration">
731        <ignored-roots>
732{GITS}
733        </ignored-roots>
734    </component>
735</project>
736"""
737
738IGNORED_GITS = """\
739<component name="VcsManagerConfiguration">
740    <ignored-roots>{GITS}</ignored-roots>
741  </component>
742"""
743