Przeglądaj źródła

Rearrange build files a bit, does not impact functionality


git-svn-id: http://svn.dmdirc.com/trunk@4586 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 15 lat temu
rodzic
commit
5a46a6f613
4 zmienionych plików z 109 dodań i 161 usunięć
  1. 0
    57
      BuildPlugins.xml
  2. 62
    0
      build-plugins.xml
  3. 38
    0
      build-svn.xml
  4. 9
    104
      build.xml

+ 0
- 57
BuildPlugins.xml Wyświetl plik

@@ -1,57 +0,0 @@
1
-<project name="DMDirc-Plugins" default="default" basedir=".">
2
-	<!-- ant-contrib default location (can be overridden in the property files below)-->
3
-	<property name="libs.antcontrib" value="/usr/share/java/ant-contrib.jar"/>
4
-	
5
-	<!-- Netbeans property files -->
6
-	<property file="nbproject/project.properties"/>
7
-	<property file="nbproject/private/private.properties"/>
8
-	<property file="${user.properties.file}"/>
9
-	<available file="${libs.antcontrib}.disabled" property="has.ant-contrib"/>
10
-	
11
-	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
12
-		<classpath>
13
-			<pathelement location="${libs.antcontrib}"/>
14
-		</classpath>
15
-	</taskdef>
16
-	
17
-	
18
-	<target name="makepluginjar">
19
-		<propertyregex property="pluginjar.name" input="${target.file}" regexp=".*[\\/](.*)$" select="\1.jar" casesensitive="false" />
20
-		<propertyregex property="folder.name" input="${target.file}" regexp=".*${build.classes.dir}/(.*)$" select="\1" casesensitive="false" />
21
-		<if>
22
-			<available file="${src.dir}/${folder.name}/.ignore"/>
23
-			<then>
24
-					<echo message="Not building: ${folder.name}" />
25
-			</then>
26
-			<else>
27
-				<echo message="Building: ${folder.name} to ${pluginjar.name}"/>
28
-				<delete file="plugins/${pluginjar.name}"/>
29
-				<jar jarfile="plugins/${pluginjar.name}" basedir="build/classes" includes="${folder.name}/**/*.class ${folder.name}/**/*.png">
30
-					<metainf file="${target.file}/plugin.info"/>
31
-				</jar>
32
-			</else>
33
-		</if>
34
-	</target>
35
-		
36
-	<target name="build-plugins" depends="build-plugins_bash, build-plugins_ant-contrib"/>
37
-	
38
-	<available file="/bin/bash" property="has.bash"/>	
39
-	<target name="build-plugins_bash" unless="has.ant-contrib" if="has.bash">
40
-		<exec executable="/bin/bash">
41
-			<arg value="createAllPluginJar.sh"/>
42
-			<arg value="${src.dir}/com/dmdirc/addons/"/>
43
-		</exec>
44
-	</target>
45
-	
46
-	<target name="build-plugins_ant-contrib" if="has.ant-contrib">
47
-		<mkdir dir="plugins/"/>
48
-		<foreach target="makepluginjar" param="target.file">
49
-			<path>
50
-				<dirset dir="${build.classes.dir}/com/dmdirc/addons/">
51
-					<include name="**/*"/>
52
-					<exclude name="**/*/*/**"/>
53
-				</dirset>
54
-			</path>
55
-		</foreach>
56
-	</target>
57
-</project>

+ 62
- 0
build-plugins.xml Wyświetl plik

@@ -0,0 +1,62 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project name="DMDirc-plugins" default="default" basedir=".">
3
+
4
+    <!-- ant-contrib default location (can be overridden in the property files below)-->
5
+    <property name="libs.antcontrib" value="/usr/share/java/ant-contrib.jar"/>
6
+    
7
+    <!-- Netbeans property files -->
8
+    <property file="nbproject/project.properties"/>
9
+    <property file="nbproject/private/private.properties"/>
10
+    <property file="${user.properties.file}"/>
11
+    <available file="${libs.antcontrib}.disabled" property="has.ant-contrib"/>
12
+    
13
+    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
14
+        <classpath>
15
+            <pathelement location="${libs.antcontrib}"/>
16
+        </classpath>
17
+    </taskdef>
18
+    
19
+    
20
+    <target name="makepluginjar">
21
+        <propertyregex property="pluginjar.name" input="${target.file}" regexp=".*[\\/](.*)$" select="\1.jar" casesensitive="false" />
22
+        <propertyregex property="folder.name" input="${target.file}" regexp=".*${build.classes.dir}/(.*)$" select="\1" casesensitive="false" />
23
+
24
+        <if>
25
+            <available file="${src.dir}/${folder.name}/.ignore"/>
26
+            <then>
27
+                    <echo message="Not building: ${folder.name}" />
28
+            </then>
29
+            <else>
30
+                <echo message="Building: ${folder.name} to ${pluginjar.name}"/>
31
+                <delete file="plugins/${pluginjar.name}"/>
32
+                <jar jarfile="plugins/${pluginjar.name}" basedir="build/classes" includes="${folder.name}/**/*.class ${folder.name}/**/*.png">
33
+                    <metainf file="${target.file}/plugin.info"/>
34
+                </jar>
35
+            </else>
36
+        </if>
37
+    </target>
38
+        
39
+    <target name="build-plugins" depends="build-plugins_bash, build-plugins_ant-contrib"/>
40
+    
41
+    <available file="/bin/bash" property="has.bash"/>    
42
+
43
+    <target name="build-plugins_bash" unless="has.ant-contrib" if="has.bash">
44
+        <exec executable="/bin/bash">
45
+            <arg value="createAllPluginJar.sh"/>
46
+            <arg value="${src.dir}/com/dmdirc/addons/"/>
47
+        </exec>
48
+    </target>
49
+    
50
+    <target name="build-plugins_ant-contrib" if="has.ant-contrib">
51
+        <mkdir dir="plugins/"/>
52
+        <foreach target="makepluginjar" param="target.file">
53
+            <path>
54
+                <dirset dir="${build.classes.dir}/com/dmdirc/addons/">
55
+                    <include name="**/*"/>
56
+                    <exclude name="**/*/*/**"/>
57
+                </dirset>
58
+            </path>
59
+        </foreach>
60
+    </target>
61
+
62
+</project>

+ 38
- 0
build-svn.xml Wyświetl plik

@@ -0,0 +1,38 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project name="DMDirc-svn" default="default" basedir=".">
3
+    <description>Adds and removes SVN information to DMDirc</description>
4
+
5
+    <!--
6
+        This will revert the svn revision in Main.java to prevent commiting the
7
+        change everyt time someone builds and causing conflicts.
8
+      -->
9
+    <target name="unsvn" depends="unsvn_nobash, unsvn_bash"/>
10
+
11
+    <target name="unsvn_bash" if="has.bash">
12
+        <exec executable="/bin/bash">
13
+            <arg value="AddSVN.sh"/>
14
+            <arg value="--post"/>
15
+        </exec>
16
+    </target>
17
+
18
+    <target name="unsvn_nobash" unless="has.bash">
19
+        <echo message="This task only works on linux"/>
20
+    </target>
21
+
22
+    <!--
23
+        This will add the svn revision to Main.java
24
+      -->
25
+    <target name="addsvn" depends="addsvn_nobash, addsvn_bash"/>
26
+
27
+    <target name="addsvn_bash" if="has.bash">
28
+        <exec executable="/bin/bash">
29
+            <arg value="AddSVN.sh"/>
30
+            <arg value="--pre"/>
31
+        </exec>
32
+    </target>
33
+
34
+    <target name="addsvn_nobash" unless="has.bash">
35
+        <echo message="This task only works on linux"/>
36
+    </target>
37
+
38
+</project>

+ 9
- 104
build.xml Wyświetl plik

@@ -1,113 +1,14 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<!-- You may freely edit this file. See commented blocks below for -->
3
-<!-- some examples of how to customize the build. -->
4
-<!-- (If you delete it and reopen the project it will be recreated.) -->
5 2
 <project name="DMDirc" default="default" basedir=".">
6 3
     <description>Builds, tests, and runs the project DMDirc.</description>
7 4
 
8 5
     <import file="nbproject/build-impl.xml"/>
9
-    <import file="BuildPlugins.xml"/>
6
+    <import file="build-plugins.xml"/>
7
+    <import file="build-svn.xml"/>
10 8
 
11
-    <!--
12
-
13
-    There exist several targets which are by default empty and which can be 
14
-    used for execution of your tasks. These targets are usually executed 
15
-    before and after some main targets. They are: 
16
-
17
-      -pre-init:                 called before initialization of project properties
18
-      -post-init:                called after initialization of project properties
19
-      -pre-compile:              called before javac compilation
20
-      -post-compile:             called after javac compilation
21
-      -pre-compile-single:       called before javac compilation of single file
22
-      -post-compile-single:      called after javac compilation of single file
23
-      -pre-compile-test:         called before javac compilation of JUnit tests
24
-      -post-compile-test:        called after javac compilation of JUnit tests
25
-      -pre-compile-test-single:  called before javac compilation of single JUnit test
26
-      -post-compile-test-single: called after javac compilation of single JUunit test
27
-      -pre-jar:                  called before JAR building
28
-      -post-jar:                 called after JAR building
29
-      -post-clean:               called after cleaning build products
30
-
31
-    (Targets beginning with '-' are not intended to be called on their own.)
32
-
33
-    Example of inserting an obfuscator after compilation could look like this:
34
-
35
-        <target name="-post-compile">
36
-            <obfuscate>
37
-                <fileset dir="${build.classes.dir}"/>
38
-            </obfuscate>
39
-        </target>
40
-
41
-    For list of available properties check the imported 
42
-    nbproject/build-impl.xml file. 
43
-
44
-
45
-    Another way to customize the build is by overriding existing main targets.
46
-    The targets of interest are: 
47
-
48
-      -init-macrodef-javac:     defines macro for javac compilation
49
-      -init-macrodef-junit:     defines macro for junit execution
50
-      -init-macrodef-debug:     defines macro for class debugging
51
-      -init-macrodef-java:      defines macro for class execution
52
-      -do-jar-with-manifest:    JAR building (if you are using a manifest)
53
-      -do-jar-without-manifest: JAR building (if you are not using a manifest)
54
-      run:                      execution of project 
55
-      -javadoc-build:           Javadoc generation
56
-      test-report:              JUnit report generation
57
-
58
-    An example of overriding the target for project execution could look like this:
59
-
60
-        <target name="run" depends="DMDirc-impl.jar">
61
-            <exec dir="bin" executable="launcher.exe">
62
-                <arg file="${dist.jar}"/>
63
-            </exec>
64
-        </target>
65
-
66
-    Notice that the overridden target depends on the jar target and not only on 
67
-    the compile target as the regular run target does. Again, for a list of available 
68
-    properties which you can use, check the target you are overriding in the
69
-    nbproject/build-impl.xml file. 
70
-<jar compress="${jar.compress}" jarfile="${build.classes.dir}/plugins/">
71
-            <fileset dir="${build.classes.dir}"/>
72
-        </jar>
73
-    -->
74
-
75
-    <available file="/bin/bash" property="has.bash"/>	
76
-
77
-    <!--
78
-        This will revert the svn revision in Main.java to prevent commiting the
79
-        change everyt time someone builds and causing conflicts.
80
-      -->
81
-    <target name="unsvn" depends="unsvn_nobash, unsvn_bash"/>
82
-    <target name="unsvn_bash" if="has.bash">
83
-        <exec executable="/bin/bash">
84
-            <arg value="AddSVN.sh"/>
85
-            <arg value="--post"/>
86
-        </exec>
87
-    </target>
88
-    <target name="unsvn_nobash" unless="has.bash">
89
-        <echo message="This task only works on linux"/>
90
-    </target>
91
-    <target name="-post-compile" depends="unsvn, build-plugins"/>
92
-
93
-    <!--
94
-        This will add the svn revision to Main.java
95
-      -->
96
-    <target name="addsvn" depends="addsvn_nobash, addsvn_bash"/>
97
-    <target name="addsvn_bash" if="has.bash">
98
-        <exec executable="/bin/bash">
99
-            <arg value="AddSVN.sh"/>
100
-            <arg value="--pre"/>
101
-        </exec>
102
-    </target>
103
-    <target name="addsvn_nobash" unless="has.bash">
104
-        <echo message="This task only works on linux"/>
105
-    </target>
106
-    <target name="-pre-compile" depends="addsvn"/>
107
-
108
-    <target name="installer" depends="installer-nobuild, installer-build"/>
9
+    <target name="installer" depends="-installer-nobuild, -installer-build"/>
109 10
     
110
-    <target name="installer-build" if="has.bash">
11
+    <target name="-installer-build" if="has.bash">
111 12
         <exec executable="/bin/bash" dir="installer" resultproperty="installer.result">
112 13
             <arg value="release.sh"/>
113 14
             <arg value="this"/>
@@ -123,7 +24,11 @@
123 24
         <echo message=""/>
124 25
     </target>
125 26
     
126
-    <target name="installer-nobuild" unless="has.bash">
27
+    <target name="-installer-nobuild" unless="has.bash">
127 28
         <echo message="This task only works on linux"/>
128 29
     </target>
30
+
31
+    <target name="-post-compile" depends="unsvn, build-plugins"/>
32
+    <target name="-pre-compile" depends="addsvn"/>
33
+
129 34
 </project>

Ładowanie…
Anuluj
Zapisz