Skip to content

Apache Lucene open-source search software

Intellij config: JDK setup: add missing interpolation marker in dev-tools/idea/.idea/misc.xml; dont print out follow-on instructions if ${idea.jdk} is defined; and when follow-on instructions are printed, show how to avoid the need to manually configure the JDK

Steven Rowec9dc2be5ffef
diff --git a/build.xml b/build.xml
index b74b66a5707..ac2b16c7e36 100644
--- a/build.xml
+++ b/build.xml
@@ -240,16 +240,33 @@
<property file="${user.home}/lucene.build.properties"/>
<property file="${user.home}/build.properties"/>
<property file="lucene/build.properties"/>
- <property name="idea.jdk" value=""/> <!-- Define ${idea.jdk} if it's not in any *build.properties file -->
+ <condition property="idea.jdk.is.set">
+ <isset property="idea.jdk"/>
+ </condition>
+ <!-- Define ${idea.jdk} if it's not in any *build.properties file -->
+ <property name="idea.jdk" value=""/>
<copy todir=".">
<fileset dir="dev-tools/idea"/>
<filterset begintoken="@" endtoken="@">
<filter token="idea.jdk" value="${idea.jdk}"/>
</filterset>
</copy>
+ <antcall target="-post-idea-instructions"/>
+ </target>
+
+ <target name="-post-idea-instructions" unless="idea.jdk.is.set">
<echo>
- To complete IntelliJ IDEA setup, you must manually configure
- File | Project Structure | Project | Project SDK.
+To complete IntelliJ IDEA setup, you must manually configure
+File | Project Structure | Project | Project SDK.
+
+You won't have to do this in the future if you define property
+$${idea.jdk}, e.g. in ~/lucene.build.properties, ~/build.properties
+or lucene/build.properties, with a value consisting of the
+following two XML attributes/values (adjust values according to
+JDKs you have defined locally - see
+File | Project Structure | Platform Settings | SDKs):
+
+ idea.jdk = project-jdk-name="1.7" project-jdk-type="JavaSDK"
</echo>
</target>
diff --git a/dev-tools/idea/.idea/misc.xml b/dev-tools/idea/.idea/misc.xml
index 958a37bb03e..5b61dafd622 100755
--- a/dev-tools/idea/.idea/misc.xml
+++ b/dev-tools/idea/.idea/misc.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7"/>
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" @idea.jdk@ />
</project>