-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
88 lines (77 loc) · 3.26 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<project name="HP ALI custom build">
<property environment="env"/>
<target name="check-args" depends="setup-maven-linux,setup-maven-win">
<fail message="IDEA_HOME not specified or invalid">
<condition>
<not>
<available file="${IDEA_HOME}" type="dir"/>
</not>
</condition>
</fail>
<fail message="Dependencies not found, your IDEA version is probably unsupported">
<condition>
<not>
<and>
<resourcecount count="1">
<fileset id="root" dir="${IDEA_HOME}" includes="build.txt"/>
</resourcecount>
<resourcecount count="5">
<fileset id="lib" dir="${IDEA_HOME}/lib" includes="util.jar,annotations.jar,extensions.jar,idea.jar,openapi.jar"/>
</resourcecount>
<resourcecount count="1">
<fileset id="tasks" dir="${IDEA_HOME}/plugins/tasks/lib" includes="tasks-api.jar"/>
</resourcecount>
</and>
</not>
</condition>
</fail>
<loadfile property="IDEA_VERSION" srcFile="${IDEA_HOME}/build.txt"/>
<loadresource property="IDEA_BUILD">
<propertyresource name="IDEA_VERSION"/>
<filterchain>
<tokenfilter>
<replaceregex pattern=".*-(\d+\.\d+)" replace="\1"/>
</tokenfilter>
</filterchain>
</loadresource>
<echo>Found IDEA build: ${IDEA_VERSION} (${IDEA_BUILD})</echo>
<echo>Maven executable: ${maven.executable}</echo>
</target>
<target name="setup-maven-win" depends="check-os" if="win_os">
<property name="maven.executable">mvn.bat</property>
</target>
<target name="setup-maven-linux" depends="check-os" unless="win_os">
<property name="maven.executable">mvn</property>
</target>
<target name="check-os">
<condition property="win_os">
<os family="windows" />
</condition>
</target>
<target name="build" depends="check-args">
<exec executable="${maven.executable}" failonerror="true">
<arg value="package"/>
<!-- needed for test execution -->
<arg value="-Didea.home.path=${IDEA_HOME}"/>
<arg value="-Didea.platform.prefix=Idea"/>
</exec>
<echo>built: ali-plugin-main/target/ali-idea-plugin.zip</echo>
</target>
<target name="test" depends="check-args">
<exec executable="${maven.executable}" failonerror="true">
<arg value="test"/>
<!-- needed for test execution -->
<arg value="-Didea.home.path=${IDEA_HOME}"/>
<arg value="-Didea.platform.prefix=Idea"/>
</exec>
</target>
<target name="install-sdk" depends="check-args">
<ant antfile="idea-sdk-${IDEA_VERSION}/install-libs.xml" target="install-libs"/>
</target>
<target name="extract-sdk" depends="check-args">
<exec executable="./extract-sdk.sh">
<arg value="${IDEA_HOME}"/>
<arg value="${IDEA_VERSION}"/>
</exec>
</target>
</project>