-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.xml
102 lines (82 loc) · 3.5 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<project name="R4Intellij" default="plugin.zip">
<!--dependencies-->
<property name="dep.idea.lib.dir" value="${idea.home}/lib"/>
<path id="dep.plugin.classpath">
<fileset dir="${dep.idea.lib.dir}">
<include name="annotations.jar"/>
<include name="forms_rt.jar"/>
<include name="app.jar"/>
<include name="rt.jar"/>
<include name="util.jar"/>
<include name="util_rt.jar"/>
<include name="winp-*.jar"/>
</fileset>
</path>
<path id="dep.javac2.classpath">
<fileset dir="${dep.idea.lib.dir}">
<include name="javac2.jar"/>
<include name="util.jar"/>
<include name="util_rt.jar"/>
<include name="asm-all.jar"/>
<include name="jgoodies-forms.jar"/>
</fileset>
</path>
<!--input-->
<property name="in.meta-inf.dir" value="META-INF"/>
<property name="in.sources.dir" value="src"/>
<property name="in.generated.sources.dir" value="gen"/>
<property name="in.resources.dir" value="resources"/>
<property name="in.r-helpers.dir" value="r-helpers"/>
<!--output-->
<property name="out.dir" value="out/ant"/>
<property name="out.classes.dir" value="${out.dir}/classes"/>
<property name="out.jar.dir" value="${out.dir}/jar"/>
<property name="out.zip.dir" value="${out.dir}/zip"/>
<property name="out.jar" value="${out.jar.dir}/${ant.project.name}.jar"/>
<property name="out.zip" value="${out.zip.dir}/${ant.project.name}.zip"/>
<!--tasks-->
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="dep.javac2.classpath"/>
<!-- kotlin support see https://kotlinlang.org/docs/reference/using-ant.html-->
<typedef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<!--targets-->
<target name="clean">
<delete dir="${out.dir}"/>
</target>
<target name="init">
<mkdir dir="${out.classes.dir}"/>
<mkdir dir="${out.jar.dir}"/>
<mkdir dir="${out.zip.dir}"/>
</target>
<target name="compile" depends="init">
<javac2 srcdir="${in.sources.dir}:${in.generated.sources.dir}"
destdir="${out.classes.dir}"
classpathref="dep.plugin.classpath"
source="1.8"
target="1.8"
debug="on"
includeantruntime="false"
>
<withKotlin/>
</javac2>
</target>
<target name="plugin.zip" depends="clean, compile"
description="create plugin bundle for upload to jetbrains repository">
<jar destfile="${out.jar}">
<zipfileset dir="${out.classes.dir}"/>
<!--<zipfileset dir="${in.resources.dir}/icons" prefix="icons"/>-->
<!--<zipfileset dir="${in.resources.dir}/inspectionDescriptions" prefix="inspectionDescriptions"/>-->
<zipfileset dir="${in.resources.dir}"/>
<!--<zipfileset dir="resources/META-INF" prefix="${in.meta-inf.dir}"/>-->
</jar>
<zip destfile="${out.zip}">
<zipfileset file="${out.jar}" prefix="${ant.project.name}/lib"/>
<zipfileset dir="${in.r-helpers.dir}" prefix="${ant.project.name}"/>
</zip>
</target>
<!-- todo still needed??-->
<target name="include_helpers">
<zip destfile="R4Intellij.zip" update="true">
<zipfileset dir="${in.r-helpers.dir}" prefix="${ant.project.name}"/>
</zip>
</target>
</project>