forked from crazyproger/Tabdir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
100 lines (84 loc) · 4.21 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2012 Vladimir Rudev
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project name="tabdir" basedir="." default="run">
<dirname property="basedir" file="${ant.file}"/>
<property file="build.properties"/>
<property name="version" value="2.0.5"/>
<!-- If the Idea and JDK on your system are not located at the paths below,
you can specify your paths in build.properties (example in build.properties.example).
If everything is fine as it is, the build.properties file may not exist,
in which case the following property values will define the paths to Idea and the JDK
(ant does not change the property value if it encounters it repeatedly) -->
<property name="idea.dir" value="/opt/idea/"/>
<property name="jdk.dir" value="/usr/lib/jvm/java-6-sun/"/>
<property name="jdk.bin.dir" value="${jdk.dir}/bin"/>
<property name="javac2.home" value="${idea.dir}/lib"/>
<property name="deploy.path" value="${idea.plugins.path}"/>
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="build"/>
<property name="tabdir.jar.file" value="${build.dir}/tabdir-redux-${version}.jar"/>
<path id="javac2.classpath">
<pathelement location="${javac2.home}/javac2.jar"/>
<pathelement location="${javac2.home}/jdom.jar"/>
<pathelement location="${javac2.home}/asm.jar"/>
<pathelement location="${javac2.home}/asm-commons.jar"/>
<pathelement location="${javac2.home}/asm-all.jar"/>
<pathelement location="${javac2.home}/jgoodies-forms.jar"/>
<pathelement location="${javac2.home}/3rd-party-rt.jar"/>
<pathelement location="${javac2.home}/util.jar"/>
<pathelement location="${javac2.home}/forms_rt.jar"/>
</path>
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
<path id="tabdir.classpath">
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<target name="clean" description="cleanup module">
<delete dir="build"/>
<delete dir="dist"/>
</target>
<target name="compile" depends="clean" description="Compile module tabdir">
<mkdir dir="${build.dir}/classes"/>
<javac2 srcdir="src/" destdir="${build.dir}/classes" debug="true" fork="true"
executable="${jdk.bin.dir}/javac" encoding="UTF-8" includeantruntime="true">
<exclude name="**/.svn/**"/>
</javac2>
<jar destfile="${tabdir.jar.file}">
<zipfileset dir="${build.dir}/classes"/>
<zipfileset file="META-INF/plugin.xml" prefix="META-INF"/>
<manifest>
<attribute name="Created-By" value="IntelliJ IDEA"/>
<attribute name="Manifest-Version" value="1.0"/>
</manifest>
</jar>
</target>
<target name="undeploy">
<delete dir="${deploy.path}/tabdir"/>
</target>
<target name="deploy" depends="undeploy,compile" description="Write the plug-in to the plug-in folder of the IDE launcher">
<copy todir="${deploy.path}" file="${tabdir.jar.file}"/>
</target>
<target name="runIDE" depends="deploy">
<exec osfamily="Unix" executable="${idea.dir}/bin/idea.sh">
<env key="IDEA_PROPERTIES" value="${basedir}/build.properties"/>
</exec>
<exec osfamily="Windows" executable="${idea.dir}/bin/idea.bat" dir="${idea.dir}/bin">
<env key="IDEA_PROPERTIES" value="${basedir}/build.properties"/>
<env key="JDK_HOME" value="${jdk.dir}"/>
</exec>
</target>
<target name="run" depends="deploy,runIDE" description="Assemble the plug-in into a zip archive, run the IDE with the plug-in"/>
</project>