-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathredpen-intellij-plugin.xml
169 lines (141 loc) · 7.62 KB
/
redpen-intellij-plugin.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?xml version="1.0" encoding="UTF-8"?>
<project name="redpen-intellij-plugin-generated" default="all">
<property name="jdk.home.intellij_idea_sdk" value="idea"/>
<!-- Compiler options -->
<property name="compiler.debug" value="on"/>
<property name="compiler.generate.no.warnings" value="off"/>
<property name="compiler.args" value=""/>
<property name="compiler.max.memory" value="700m"/>
<patternset id="library.patterns">
<include name="*.jar"/>
</patternset>
<patternset id="compiler.resources">
<exclude name="**/?*.kt"/>
<exclude name="**/?*.java"/>
<exclude name="**/?*.form"/>
<exclude name="**/?*.class"/>
</patternset>
<!-- JDK definitions -->
<property name="jdk.bin.intellij_idea_sdk" value="${java.home}/../bin"/>
<path id="jdk.classpath.intellij_idea_sdk">
<fileset dir="${jdk.home.intellij_idea_sdk}">
<include name="lib/*.jar"/>
</fileset>
</path>
<property name="project.jdk.home" value="${jdk.home.intellij_idea_sdk}"/>
<property name="project.jdk.bin" value="${jdk.bin.intellij_idea_sdk}"/>
<property name="project.jdk.classpath" value="jdk.classpath.intellij_idea_sdk"/>
<property name="kotlin.lib" value="${jdk.home.intellij_idea_sdk}/plugins/Kotlin/kotlinc/lib"/>
<typedef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<!-- Module redpen-intellij-plugin -->
<dirname property="module.redpen-intellij-plugin.basedir" file="${ant.file}"/>
<property name="module.jdk.home.redpen-intellij-plugin" value="${project.jdk.home}"/>
<property name="module.jdk.bin.redpen-intellij-plugin" value="${project.jdk.bin}"/>
<property name="module.jdk.classpath.redpen-intellij-plugin" value="${project.jdk.classpath}"/>
<property name="compiler.args.redpen-intellij-plugin" value="-encoding UTF-8 -source 8 -target 1.8 ${compiler.args}"/>
<property name="redpen-intellij-plugin.output.dir" value="${module.redpen-intellij-plugin.basedir}/out/production/redpen-intellij-plugin"/>
<property name="redpen-intellij-plugin.testoutput.dir" value="${module.redpen-intellij-plugin.basedir}/out/test/redpen-intellij-plugin"/>
<path id="redpen-intellij-plugin.module.production.classpath">
<fileset dir="${basedir}/lib/default">
<patternset refid="library.patterns"/>
</fileset>
<path refid="${module.jdk.classpath.redpen-intellij-plugin}"/>
</path>
<path id="redpen-intellij-plugin.runtime.production.module.classpath">
<pathelement location="${redpen-intellij-plugin.output.dir}"/>
<fileset dir="${basedir}/lib/default">
<patternset refid="library.patterns"/>
</fileset>
</path>
<path id="redpen-intellij-plugin.module.classpath">
<pathelement location="${redpen-intellij-plugin.output.dir}"/>
<fileset dir="${basedir}/lib/default">
<patternset refid="library.patterns"/>
</fileset>
<fileset dir="${basedir}/lib/test">
<patternset refid="library.patterns"/>
</fileset>
<path refid="${module.jdk.classpath.redpen-intellij-plugin}"/>
</path>
<path id="redpen-intellij-plugin.runtime.module.classpath">
<pathelement location="${redpen-intellij-plugin.testoutput.dir}"/>
<pathelement location="${redpen-intellij-plugin.output.dir}"/>
<fileset dir="${basedir}/lib/default">
<patternset refid="library.patterns"/>
</fileset>
<fileset dir="${basedir}/lib/test">
<patternset refid="library.patterns"/>
</fileset>
</path>
<target name="compile.module.redpen-intellij-plugin" depends="compile.module.redpen-intellij-plugin.production,compile.module.redpen-intellij-plugin.tests" description="Compile module redpen-intellij-plugin"/>
<target name="compile.module.redpen-intellij-plugin.production" description="Compile module redpen-intellij-plugin; production classes">
<mkdir dir="${redpen-intellij-plugin.output.dir}"/>
<kotlinc src="${module.redpen-intellij-plugin.basedir}/src" output="${redpen-intellij-plugin.output.dir}" moduleName="intellij">
<classpath refid="redpen-intellij-plugin.module.production.classpath"/>
</kotlinc>
<copy todir="${redpen-intellij-plugin.output.dir}">
<fileset dir="${module.redpen-intellij-plugin.basedir}/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile.module.redpen-intellij-plugin.tests" depends="compile.module.redpen-intellij-plugin.production" description="compile module redpen-intellij-plugin; test classes">
<mkdir dir="${redpen-intellij-plugin.testoutput.dir}"/>
<kotlinc output="${redpen-intellij-plugin.testoutput.dir}" moduleName="intellij">
<src path="${module.redpen-intellij-plugin.basedir}/src"/>
<src path="${module.redpen-intellij-plugin.basedir}/test"/>
<classpath refid="redpen-intellij-plugin.module.classpath"/>
</kotlinc>
<copy todir="${redpen-intellij-plugin.testoutput.dir}">
<fileset dir="${module.redpen-intellij-plugin.basedir}/test">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="test" depends="compile.module.redpen-intellij-plugin.tests">
<junit printsummary="yes" haltonfailure="yes" fork="yes">
<classpath>
<path refid="redpen-intellij-plugin.module.classpath"/>
<path location="${redpen-intellij-plugin.output.dir}"/>
<path location="${redpen-intellij-plugin.testoutput.dir}"/>
</classpath>
<formatter type="brief" usefile="no"/>
<batchtest>
<fileset dir="${redpen-intellij-plugin.testoutput.dir}" includes="**/*Test.class" excludes="**/Base*Test.class"/>
</batchtest>
</junit>
</target>
<target name="clean.module.redpen-intellij-plugin" description="cleanup module">
<delete dir="${redpen-intellij-plugin.output.dir}"/>
<delete dir="${redpen-intellij-plugin.testoutput.dir}"/>
</target>
<property name="redpen-intellij-plugin.plugin.path.jar" value="${module.redpen-intellij-plugin.basedir}/redpen-intellij-plugin.zip"/>
<!-- Build archive for plugin 'redpen-intellij-plugin' -->
<target name="plugin.build.jar.redpen-intellij-plugin" depends="compile.module.redpen-intellij-plugin" description="Build plugin archive for module 'redpen-intellij-plugin'">
<property name="tmp.dir.redpen-intellij-plugin" value="${module.redpen-intellij-plugin.basedir}/../temp/redpen-intellij-plugin"/>
<mkdir dir="${tmp.dir.redpen-intellij-plugin}"/>
<mkdir dir="${tmp.dir.redpen-intellij-plugin}/lib"/>
<jar destfile="${tmp.dir.redpen-intellij-plugin}/lib/redpen-intellij-plugin.jar" duplicate="preserve">
<zipfileset dir="${module.redpen-intellij-plugin.basedir}/out/production/redpen-intellij-plugin"/>
<zipfileset file="${module.redpen-intellij-plugin.basedir}/META-INF/plugin.xml" prefix="META-INF"/>
<manifest>
<attribute name="Created-By" value="IntelliJ IDEA"/>
<attribute name="Manifest-Version" value="1.0"/>
</manifest>
</jar>
<copy todir="${tmp.dir.redpen-intellij-plugin}/lib/">
<fileset dir="${module.redpen-intellij-plugin.basedir}/lib/default">
<include name="*.jar"/>
</fileset>
</copy>
<zip destfile="${redpen-intellij-plugin.plugin.path.jar}">
<fileset dir="${module.redpen-intellij-plugin.basedir}/../temp"/>
</zip>
<delete dir="${tmp.dir.redpen-intellij-plugin}"/>
</target>
<target name="clean" depends="clean.module.redpen-intellij-plugin" description="cleanup all"/>
<target name="build.modules" depends="clean, plugin.build.jar.redpen-intellij-plugin" description="build all modules"/>
<target name="all" depends="build.modules,test" description="build all"/>
</project>