mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
build scripts: use new standard options, output and temp directory in Ant script for IDEA Community
Previously output directory was set to '$home/out' by default, but this directory is used as the project compiler output in idea-community project, so calling dist.gant from idea-community project cleared the compiled classes.
This commit is contained in:
@@ -1,33 +1,16 @@
|
||||
<!--
|
||||
This build script compiles IntelliJ IDEA. Options include:
|
||||
-Dout=/path/to/out/dir, defaults to ${basedir}/out
|
||||
-Dbuild=123, defaults to SNAPSHOT
|
||||
-Dtestpatterns=com.foo.*, defaults to empty string
|
||||
This build script compiles, build distribution archives and run tests in IntelliJ IDEA Community Edition. Build process can be customized
|
||||
via options, see org.jetbrains.intellij.build.BuildOptions and org.jetbrains.intellij.build.TestingOptions classes for details. System properties
|
||||
from these classes can be passed as Ant properties in the command line, e.g. run 'ant -Dintellij.build.output.root=/path/to/dir' to
|
||||
specify custom output directory.
|
||||
|
||||
Note that this script is for building IntelliJ IDEA Community Edition only. If you want to build your own product based on IntelliJ Platform,
|
||||
create a gant script for it, see javadoc for org.jetbrains.intellij.build for details.
|
||||
-->
|
||||
<project name="IntelliJ IDEA Community Edition" default="all">
|
||||
<project name="IntelliJ IDEA Community Edition" default="build">
|
||||
<property name="project.home" value="${basedir}"/>
|
||||
|
||||
<condition property="out.dir" value="${out}" else="${project.home}/out">
|
||||
<isset property="out" />
|
||||
</condition>
|
||||
|
||||
<condition property="build.number" value="${build}" else="SNAPSHOT">
|
||||
<isset property="build" />
|
||||
</condition>
|
||||
|
||||
<condition property="test.patterns" value="${testpatterns}" else="">
|
||||
<isset property="testpatterns" />
|
||||
</condition>
|
||||
|
||||
<property name="tmp.dir" value="${out.dir}/tmp"/>
|
||||
|
||||
<target name="cleanup">
|
||||
<delete dir="${out.dir}" failonerror="false"/>
|
||||
</target>
|
||||
|
||||
<target name="init">
|
||||
<mkdir dir="${out.dir}"/>
|
||||
<mkdir dir="${tmp.dir}"/>
|
||||
<condition property="gradle.executable" value="${project.home}/build/dependencies/gradlew.bat"
|
||||
else="${project.home}/build/dependencies/gradlew">
|
||||
<os family="windows"/>
|
||||
@@ -35,6 +18,10 @@
|
||||
<exec executable="${gradle.executable}" dir="${project.home}/build/dependencies" failonerror="true">
|
||||
<arg value="setupKotlin"/>
|
||||
</exec>
|
||||
<propertyset id="intellij.build.properties">
|
||||
<propertyref name="build.number"/>
|
||||
<propertyref prefix="intellij.build."/>
|
||||
</propertyset>
|
||||
</target>
|
||||
|
||||
<macrodef name="call_gant">
|
||||
@@ -43,13 +30,9 @@
|
||||
<java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true">
|
||||
<jvmarg line="-Xmx812m -XX:MaxPermSize=152m"/>
|
||||
<sysproperty key="jna.nosys" value="true" />
|
||||
<sysproperty key="out" value="${out.dir}" />
|
||||
<sysproperty key="buildNumber" value="${build.number}" />
|
||||
<sysproperty key="idea.test.patterns" value="${test.patterns}" />
|
||||
<sysproperty key="java.awt.headless" value="true"/>
|
||||
<sysproperty key="gant.script" value="@{script}"/>
|
||||
<sysproperty key="teamcity.build.tempDir" value="${tmp.dir}"/>
|
||||
<sysproperty key="idea.test.group" value="ALL_EXCLUDE_DEFINED"/>
|
||||
<syspropertyset refid="intellij.build.properties"/>
|
||||
<arg value="-f"/>
|
||||
<arg value="${project.home}/build/gant.xml"/>
|
||||
</java>
|
||||
@@ -67,6 +50,9 @@
|
||||
<!-- The build task creates an updater.jar in ${out.dir}. This task bundles the updater and its dependencies into a single jar -->
|
||||
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${project.home}/build/lib/jarjar-1.0.jar"/>
|
||||
<target name="fullupdater" depends="build">
|
||||
<condition property="out.dir" value="${intellij.build.output.root}" else="${project.home}/out">
|
||||
<isset property="intellij.build.output.root"/>
|
||||
</condition>
|
||||
<jarjar jarfile="${out.dir}/updater-full.jar">
|
||||
<zipfileset src="${out.dir}/updater.jar" />
|
||||
<zipfileset src="lib/log4j.jar" />
|
||||
@@ -74,6 +60,4 @@
|
||||
<zipfileset src="lib/jna-utils.jar" />
|
||||
</jarjar>
|
||||
</target>
|
||||
|
||||
<target name="all" depends="cleanup,build"/>
|
||||
</project>
|
||||
|
||||
+1
-12
@@ -21,21 +21,12 @@ import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome
|
||||
|
||||
includeTargets << new File("${guessHome(this)}/build/scripts/utils.gant")
|
||||
|
||||
requireProperty("out", "$home/out")
|
||||
|
||||
// "out" has to be canonical, otherwise the ant build fails
|
||||
// with mysterious errors
|
||||
String out = new File(out).getCanonicalPath()
|
||||
|
||||
target(compile: "Compile project") {
|
||||
def options = new BuildOptions()
|
||||
options.outputRootPath = out
|
||||
new IdeaCommunityBuilder(home, binding, options).compileModules()
|
||||
new IdeaCommunityBuilder(home, binding).compileModules()
|
||||
}
|
||||
|
||||
target('default': 'The default target') {
|
||||
def options = new BuildOptions()
|
||||
options.outputRootPath = out
|
||||
options.buildNumber = null //we cannot provide consistent build number for IDEA Community if it's built separately so use *.SNAPSHOT number to avoid confusion
|
||||
new IdeaCommunityBuilder(home, binding, options).buildDistributions()
|
||||
}
|
||||
@@ -43,14 +34,12 @@ target('default': 'The default target') {
|
||||
//todo[nik] do we really need this target? update.xml calls layout.gant directly
|
||||
target('build-dist-jars' : 'Target to build jars from locally compiled classes') {
|
||||
def options = new BuildOptions()
|
||||
options.outputRootPath = out
|
||||
options.useCompiledClassesFromProjectOutput = true
|
||||
new IdeaCommunityBuilder(home, binding, options).buildDistJars()
|
||||
}
|
||||
|
||||
target('build-intellij-core' : 'Build intellij-core.zip') {
|
||||
def options = new BuildOptions()
|
||||
options.outputRootPath = out
|
||||
new IdeaCommunityBuilder(home, binding, options).buildIntelliJCore()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user