Browse Source

Convert parser to standalone project

Change-Id: Id91f50347ce9a63ebbfa0be1792c0feba7348d87
Reviewed-on: http://gerrit.dmdirc.com/2503
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.7rc1
Greg Holmes 12 years ago
parent
commit
bb4f862374

+ 9
- 2
.gitignore View File

@@ -1,3 +1,10 @@
1
-/build
1
+#.gitignore file
2
+
3
+/*.key
4
+/build/
2 5
 /dist
3
-/reports
6
+/lib/*.jar
7
+build-before-profiler.xml
8
+/nbproject/profiler-build-impl.xml
9
+/nbproject/genfiles.properties
10
+/nbproject/private

+ 47
- 0
build-ivy.xml View File

@@ -0,0 +1,47 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project name="DMDirc-ivy" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
3
+    <description>Ivy utilities for DMDirc</description>
4
+
5
+    <property name="ivy.install.version" value="2.2.0"/>
6
+    <property name="ivy.cache.ttl.default" value="7d"/>
7
+
8
+    <target name="-init-lib-directory">
9
+        <mkdir dir="lib"/>
10
+    </target>
11
+
12
+    <target name="-init-ivy" depends="-init-lib-directory">
13
+        <path id="lib.classpath">
14
+           <fileset dir="lib" includes="*.jar"/>
15
+        </path>
16
+
17
+        <available classname="org.apache.ivy.ant.IvyConfigure"
18
+              property="ivy.available" classpathref="lib.classpath" />
19
+    </target>
20
+
21
+    <target name="-download-ivy" depends="-init-ivy" unless="ivy.available">
22
+        <echo message="Retrieving Ivy"/>
23
+        <get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
24
+             dest="lib/ivy-${ivy.install.version}.jar"/>
25
+    </target>
26
+
27
+    <target name="-init-dependencies" depends="-download-ivy" unless="ivy.done">
28
+        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="lib.classpath"/>
29
+        <ivy:settings file="etc/ivy/ivysettings.xml"/>
30
+        <ivy:retrieve symlink="true" pattern="lib/[artifact]-[revision].[ext]" />
31
+        <pathconvert property="lib.classpath.computed" dirsep="/" pathsep=":">
32
+            <path>
33
+                <fileset dir="lib" includes="*.jar"/>
34
+            </path>
35
+            <map from="${basedir}${file.separator}" to=""/>
36
+        </pathconvert>
37
+        <touch mkdirs="true" file="nbproject/private/private.properties"/>
38
+        <propertyfile file="nbproject/private/private.properties">
39
+            <entry operation="=" key="lib.classpath" value="${lib.classpath.computed}"/>
40
+        </propertyfile>
41
+        <property name="ivy.done" value="true"/>
42
+    </target>
43
+
44
+    <target name="-post-clean">
45
+        <delete dir="lib"/>
46
+    </target>
47
+</project>

+ 18
- 0
build-versioning.xml View File

@@ -0,0 +1,18 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project name="DMDirc-versioning" default="default" basedir=".">
3
+    <description>Adds automatic versioning information to DMDirc</description>
4
+
5
+    <available file=".git" property="is.git"/>
6
+
7
+    <target name="-init-version">
8
+        <taskdef name="git-describe" classname="org.mdonoughe.JGitDescribeTask" classpathref="lib.classpath"/>
9
+    </target>
10
+
11
+    <target name="-add-version" depends="-init-version, -add-git-version" />
12
+
13
+    <target name="-add-git-version" if="is.git">
14
+       <git-describe dir=".git" property="parsers.version.main" subdir="${src.dir}/com/dmdirc/parser/common/;${src.dir}/com/dmdirc/parser/interfaces/" />
15
+       <git-describe dir=".git" property="parsers.version.irc" subdir="${src.dir}/com/dmdirc/parser/irc/" />
16
+    </target>
17
+
18
+</project>

+ 20
- 82
build.xml View File

@@ -1,80 +1,17 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<project name="DMDirc Parsers" default="default" basedir=".">
3
-    <description>Builds, packages and tests DMDirc parsers.</description>
4
-
5
-    <property name="parsers.src" location="src"/>
6
-    <property name="parsers.test" location="test"/>
7
-    <property name="parsers.build" location="build"/>
8
-    <property name="parsers.build.main" location="${parsers.build}/main"/>
9
-    <property name="parsers.build.irc" location="${parsers.build}/irc"/>
10
-    <property name="parsers.build.test" location="${parsers.build}/test"/>
11
-    <property name="parsers.reports" location="reports"/>
12
-    <property name="parsers.lib" location="lib"/>
13
-    <property name="parsers.dist" location="dist"/>
14
-
15
-    <path id="parsers.classpath.test">
16
-        <pathelement path="${parsers.build.main}"/>
17
-        <pathelement path="${parsers.build.irc}"/>
18
-        <fileset dir="${parsers.lib}" includes="*.jar"/>
19
-    </path>
20
-
21
-    <taskdef name="git-describe" classname="org.mdonoughe.JGitDescribeTask" classpathref="parsers.classpath.test"/>
22
-
23
-    <target name="-init-compile">
24
-       <mkdir dir="${parsers.build.main}"/>
25
-       <mkdir dir="${parsers.build.irc}"/>
26
-    </target>
27
-
28
-    <target name="-init-compile-tests">
29
-       <mkdir dir="${parsers.build.test}"/>
30
-    </target>
31
-
32
-    <target name="-init-jar">
33
-       <mkdir dir="${parsers.dist}"/>
34
-    </target>
35
-
36
-    <target name="-init-test">
37
-       <mkdir dir="${parsers.reports}"/>
38
-    </target>
39
-
40
-    <target name="-retrieve-versions">
41
-       <git-describe dir=".git" property="parsers.version.main" subdir="${parsers.src}/com/dmdirc/parser/common/;${parsers.src}/com/dmdirc/parser/interfaces/" />
42
-       <git-describe dir=".git" property="parsers.version.irc" subdir="${parsers.src}/com/dmdirc/parser/irc/" />
43
-    </target>
44
-
45
-    <target name="compile" depends="-init-compile">
46
-       <javac srcdir="${parsers.src}" destdir="${parsers.build.main}"
47
-              includeantruntime="false" excludes="com/dmdirc/parser/irc/**"/>
48
-       <javac srcdir="${parsers.src}" destdir="${parsers.build.irc}"
49
-              includeantruntime="false" includes="com/dmdirc/parser/irc/**"
50
-              classpath="${parsers.build.main}"/>
51
-    </target>
52
-
53
-    <target name="compile-tests" depends="compile,-init-compile-tests">
54
-       <javac srcdir="${parsers.test}" destdir="${parsers.build.test}"
55
-              includeantruntime="false" classpathref="parsers.classpath.test">
56
-       </javac>
57
-    </target>
58
-
59
-    <target name="test" depends="compile-tests,-init-test">
60
-       <junit printsummary="true">
61
-          <classpath>
62
-             <path refid="parsers.classpath.test"/>
63
-             <pathelement location="${parsers.build.test}"/>
64
-          </classpath>
65
-          <batchtest todir="${parsers.reports}">
66
-             <fileset dir="${parsers.build.test}" includes="**/*Test.class"/>
67
-             <formatter type="xml"/>
68
-          </batchtest>
69
-       </junit>
70
-
71
-       <junitreport todir="${parsers.reports}">
72
-          <fileset dir="${parsers.reports}" includes="TEST-*.xml"/>
73
-       </junitreport>
74
-    </target>
75
-
76
-    <target name="jar" depends="compile,-init-jar,-retrieve-versions">
77
-       <jar destfile="${parsers.dist}/parser.common.jar" basedir="${parsers.build.main}">
2
+<project name="DMDirc-Parser" default="default" basedir=".">
3
+    <description>Builds, tests, and runs the project DMDirc-Parser.</description>
4
+
5
+    <import file="nbproject/build-impl.xml"/>
6
+    <import file="build-ivy.xml"/>
7
+    <import file="build-versioning.xml"/>
8
+
9
+    <target name="-pre-init" depends="-init-dependencies"/>
10
+    <target name="-post-compile" depends="-add-version"/>
11
+    <target depends="init,compile,-pre-jar,-do-jar, -post-jar" description="Build JAR." name="jar"/>
12
+    <target name="-do-jar">
13
+        <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.dir}/parser.common.jar"
14
+                basedir="${build.classes.dir}" excludes="com/dmdirc/parser/irc/**">
78 15
           <manifest>
79 16
              <section name="com.dmdirc.parser">
80 17
                 <attribute name="Implementation-Title" value="Common parser files"/>
@@ -82,7 +19,8 @@
82 19
              </section>
83 20
           </manifest>
84 21
        </jar>
85
-       <jar destfile="${parsers.dist}/parser.irc.jar" basedir="${parsers.build.irc}">
22
+       <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.dir}/parser.irc.jar"
23
+            basedir="${build.classes.dir}" includes="com/dmdirc/parser/irc/**">
86 24
           <manifest>
87 25
              <section name="com.dmdirc.parser.irc">
88 26
                 <attribute name="Implementation-Title" value="IRC Parser"/>
@@ -91,10 +29,10 @@
91 29
           </manifest>
92 30
        </jar>
93 31
     </target>
94
-
95
-    <target name="clean">
96
-       <delete dir="${parsers.build}"/>
97
-       <delete dir="${parsers.dist}"/>
98
-       <delete dir="${parsers.reports}"/>
32
+    <target name="-post-jar">
33
+        <delete file="${manifest.file}"/>
34
+    </target>
35
+    <target name="-post-test-run">
36
+        <delete file="${manifest.file}"/>
99 37
     </target>
100 38
 </project>

+ 17
- 0
etc/ivy/ivysettings.xml View File

@@ -0,0 +1,17 @@
1
+<ivysettings>
2
+    <settings defaultResolver="default"/>
3
+    <resolvers>
4
+        <ibiblio name="default" m2compatible="true"/>
5
+
6
+        <ibiblio name="jgit" root="http://download.eclipse.org/jgit/maven" m2compatible="true"/>
7
+
8
+        <url name="jgit-describe">
9
+            <ivy pattern="file:///${basedir}/etc/ivy/[module]/ivy.xml"/>
10
+            <artifact pattern="http://shanemcc.github.com/jgit-describe/releases/jgit-describe-[revision].jar"/>
11
+        </url>
12
+    </resolvers>
13
+    <modules>
14
+        <module organisation="com.github.shanemcc" name="jgit-describe" resolver="jgit-describe"/>
15
+        <module organisation="org.eclipse.jgit" name="*" resolver="jgit"/>
16
+    </modules>
17
+</ivysettings>

+ 6
- 0
etc/ivy/jgit-describe/ivy.xml View File

@@ -0,0 +1,6 @@
1
+<ivy-module version="2.0">
2
+    <info organisation="com.github.shanemcc" module="jgit-describe"/>
3
+    <dependencies>
4
+        <dependency org="org.eclipse.jgit" name="org.eclipse.jgit" rev="latest.integration" conf="default" />
5
+    </dependencies>
6
+</ivy-module>

+ 18
- 0
ivy.xml View File

@@ -0,0 +1,18 @@
1
+<ivy-module version="2.0">
2
+    <info organisation="com.dmdirc" module="utils"/>
3
+
4
+    <configurations>
5
+        <conf name="build" description="Everything needed to build"/>
6
+        <conf name="compile" description="Everything needed to compile"/>
7
+        <conf name="test" description="Everything needed to test"/>
8
+        <conf name="default" extends="build,compile,test"/>
9
+    </configurations>
10
+
11
+    <dependencies defaultconfmapping="*->default">
12
+        <dependency org="com.github.shanemcc" name="jgit-describe" rev="0.2" conf="build" />
13
+        <dependency org="junit" name="junit" rev="4.+" conf="test" />
14
+        <dependency org="org.mockito" name="mockito-all" rev="1.+" conf="test" />
15
+
16
+        <exclude org="ant" module="ant"/>
17
+    </dependencies>
18
+</ivy-module>

+ 0
- 0
lib/nblibraries.properties View File


+ 1078
- 0
nbproject/build-impl.xml
File diff suppressed because it is too large
View File


+ 96
- 0
nbproject/project.properties View File

@@ -0,0 +1,96 @@
1
+annotation.processing.enabled=true
2
+annotation.processing.enabled.in.editor=true
3
+annotation.processing.processors.list=
4
+annotation.processing.run.all.processors=true
5
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
6
+application.title=DMDirc-Parser
7
+application.vendor=DMDirc
8
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
9
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=4
10
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=4
11
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=8
12
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=80
13
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
14
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
15
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.allowConvertToStarImport=false
16
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.countForUsingStaticStarImport=1
17
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=com.dmdirc;com.google;com.palantir;java;javax;lombok;net.miginfocom;org;*;static *
18
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateStaticImports=true
19
+build.classes.dir=${build.dir}/classes
20
+build.classes.excludes=**/*.java,**/*.form
21
+# This directory is removed when the project is cleaned:
22
+build.dir=build
23
+build.generated.dir=${build.dir}/generated
24
+build.generated.sources.dir=${build.dir}/generated-sources
25
+# Only compile against the classpath explicitly listed here:
26
+build.sysclasspath=ignore
27
+build.test.classes.dir=${build.dir}/test/classes
28
+build.test.results.dir=${build.dir}/test/results
29
+# Uncomment to specify the preferred debugger connection transport:
30
+#debug.transport=dt_socket
31
+debug.classpath=\
32
+    ${run.classpath}
33
+debug.test.classpath=\
34
+    ${run.test.classpath}
35
+# This directory is removed when the project is cleaned:
36
+dist.dir=dist
37
+dist.jar=${dist.dir}/DMDirc-Parser.jar
38
+dist.javadoc.dir=${dist.dir}/javadoc
39
+endorsed.classpath=
40
+excludes=
41
+includes=**
42
+jar.archive.disabled=${jnlp.enabled}
43
+jar.compress=false
44
+jar.index=${jnlp.enabled}
45
+javac.classpath=\
46
+    ${lib.classpath}
47
+# Space-separated list of extra javac options
48
+javac.compilerargs=
49
+javac.deprecation=true
50
+javac.processorpath=\
51
+    ${javac.classpath}
52
+javac.source=1.6
53
+javac.target=1.6
54
+javac.test.classpath=\
55
+    ${javac.classpath}:\
56
+    ${build.classes.dir}
57
+javac.test.processorpath=\
58
+    ${javac.test.classpath}
59
+javadoc.additionalparam=
60
+javadoc.author=false
61
+javadoc.encoding=${source.encoding}
62
+javadoc.noindex=false
63
+javadoc.nonavbar=false
64
+javadoc.notree=false
65
+javadoc.private=false
66
+javadoc.splitindex=true
67
+javadoc.use=true
68
+javadoc.version=false
69
+javadoc.windowtitle=
70
+jnlp.codebase.type=no.codebase
71
+jnlp.descriptor=application
72
+jnlp.enabled=false
73
+jnlp.mixed.code=default
74
+jnlp.offline-allowed=false
75
+jnlp.signed=false
76
+jnlp.signing=
77
+jnlp.signing.alias=
78
+jnlp.signing.keystore=
79
+main.class=
80
+manifest.file=manifest.mf
81
+meta.inf.dir=${src.dir}/META-INF
82
+mkdist.disabled=false
83
+platform.active=default_platform
84
+run.classpath=\
85
+    ${javac.classpath}:\
86
+    ${build.classes.dir}
87
+# Space-separated list of JVM arguments used when running the project
88
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
89
+# or test-sys-prop.name=value to set system properties for unit tests):
90
+run.jvmargs=
91
+run.test.classpath=\
92
+    ${javac.test.classpath}:\
93
+    ${build.test.classes.dir}
94
+source.encoding=UTF-8
95
+src.dir=src
96
+test.src.dir=test

+ 18
- 0
nbproject/project.xml View File

@@ -0,0 +1,18 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://www.netbeans.org/ns/project/1">
3
+    <type>org.netbeans.modules.java.j2seproject</type>
4
+    <configuration>
5
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
6
+            <name>DMDirc-Parser</name>
7
+            <source-roots>
8
+                <root id="src.dir"/>
9
+            </source-roots>
10
+            <test-roots>
11
+                <root id="test.src.dir"/>
12
+            </test-roots>
13
+        </data>
14
+        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
15
+            <definitions>./lib/nblibraries.properties</definitions>
16
+        </libraries>
17
+    </configuration>
18
+</project>

Loading…
Cancel
Save