Mercurial > cgi-bin > hgweb.cgi > ClipMan
annotate build.xml @ 50:3f8409470fdf
Input type to SetOnceImpl cannot be nullable.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sun, 12 Apr 2020 18:45:23 -0700 |
parents | 19d9da731c43 |
children | e8d2a7e6f6c7 |
rev | line source |
---|---|
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
1 <?xml version="1.0" encoding="UTF-8"?> |
25 | 2 <project name="ClipMan" default="help" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"> |
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
3 <!-- import all environment variables as env.* --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
4 <property environment="env"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
5 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
6 <!-- ensure required environment variables are set --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
7 <macrodef name="env-require"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
8 <attribute name="name"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
9 <sequential> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
10 <fail message="Environment variable @{name} not set!"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
11 <condition> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
12 <not><isset property="env.@{name}"/></not> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
13 </condition> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
14 </fail> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
15 </sequential> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
16 </macrodef> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
17 <env-require name="JRE_HOME"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
18 <env-require name="KOTLIN_HOME"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
19 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
20 <!-- define the kotlin task --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
21 <property name="kotlin.lib" value="${env.KOTLIN_HOME}/libexec/lib"/> |
25 | 22 <typedef resource="org/jetbrains/kotlin/ant/antlib.xml" |
23 classpath="${kotlin.lib}/kotlin-ant.jar"/> | |
24 | |
25 <!-- define the package-building tasks --> | |
26 <taskdef resource="com/sun/javafx/tools/ant/antlib.xml" | |
27 uri="javafx:com.sun.javafx.tools.ant" | |
28 classpath="${env.JRE_HOME}/lib/ant-javafx.jar"/> | |
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
29 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
30 <!-- cribbed from https://stackoverflow.com/questions/7129672/uppercase-lowercase-capitalize-an-ant-property --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
31 <scriptdef language="javascript" name="toLowerCase"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
32 <attribute name="value" /> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
33 <attribute name="target" /> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
34 <![CDATA[ |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
35 project.setProperty( attributes.get( "target" ), |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
36 attributes.get( "value" ).toLowerCase() ); |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
37 ]]> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
38 </scriptdef> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
39 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
40 <!-- Define the properties used by the build --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
41 <property name="app.name" value="${ant.project.name}"/> |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
42 <property name="app.entry" value="name.blackcap.clipman.MainKt"/> |
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
43 <toLowerCase target="lc.app.name" value="${app.name}"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
44 <property name="jar.name" value="${basedir}/${lc.app.name}.jar"/> |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
45 <property name="work.jar" value="${basedir}/work.jar"/> |
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
46 <property name="lib.home" value="${basedir}/lib"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
47 <property name="src.home" value="${basedir}/src"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
48 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
49 <!-- help message --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
50 <target name="help"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
51 <echo>You can use the following targets:</echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
52 <echo> </echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
53 <echo> help : (default) Prints this message </echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
54 <echo> all : Cleans, compiles, and stages application</echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
55 <echo> clean : Deletes work directories</echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
56 <echo> compile : Compiles servlets into class files</echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
57 <echo> jar : Make JAR file.</echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
58 <echo> </echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
59 <echo>For example, to clean, compile, and package all at once, run:</echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
60 <echo>prompt> ant all </echo> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
61 </target> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
62 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
63 <!-- Define the CLASSPATH --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
64 <target name="classpath"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
65 <path id="std.classpath"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
66 <fileset dir="${lib.home}"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
67 <include name="*.jar"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
68 </fileset> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
69 </path> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
70 <path id="compile.classpath"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
71 <path refid="std.classpath"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
72 <pathelement location="${src.home}"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
73 </path> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
74 <path id="test.classpath"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
75 <path refid="std.classpath"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
76 <pathelement location="${work.home}"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
77 </path> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
78 </target> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
79 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
80 <!-- do everything but install --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
81 <target name="all" depends="jar" |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
82 description="Clean work dirs, compile, make JAR."/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
83 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
84 <!-- compile *.kt to *.class --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
85 <target name="compile" depends="classpath" |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
86 description="Compile Java sources to ${work.home}"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
87 <kotlinc src="${src.home}" output="${work.jar}" |
47
19d9da731c43
Recoded; cleaned up root namespace, removed race conditions.
David Barts <n5jrn@me.com>
parents:
42
diff
changeset
|
88 classpathref="compile.classpath"> |
19d9da731c43
Recoded; cleaned up root namespace, removed race conditions.
David Barts <n5jrn@me.com>
parents:
42
diff
changeset
|
89 <compilerarg line="-jvm-target 1.8"/> |
19d9da731c43
Recoded; cleaned up root namespace, removed race conditions.
David Barts <n5jrn@me.com>
parents:
42
diff
changeset
|
90 </kotlinc> |
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
91 </target> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
92 |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
93 <!-- make .jar file --> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
94 <target name="jar" depends="compile" description="Create JAR file."> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
95 <jar destfile="${jar.name}"> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
96 <manifest> |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
97 <attribute name="Main-Class" value="${app.entry}"/> |
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
98 </manifest> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
99 <zipgroupfileset dir="${lib.home}" includes="*.jar"/> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
100 <zipfileset src="${work.jar}"/> |
42 | 101 <zipfileset dir="${src.home}" includes="**/*.properties"/> |
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
102 </jar> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
103 </target> |
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
104 |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
105 <!-- for making bundled apps --> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
106 <macrodef name="bundle"> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
107 <attribute name="type"/> |
23 | 108 <element name="args"/> |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
109 <sequential> |
25 | 110 <fx:deploy nativeBundles="@{type}" outdir="${basedir}" outfile="${app.name}" |
111 signBundle="false"> | |
112 <fx:application mainClass="${app.entry}" name="${app.name}" toolkit="swing" | |
47
19d9da731c43
Recoded; cleaned up root namespace, removed race conditions.
David Barts <n5jrn@me.com>
parents:
42
diff
changeset
|
113 version="1.01"/> |
25 | 114 <fx:info description="ClipMan, a clipboard manager." title="${app.name}" |
27
8aa2dfac27eb
Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
25
diff
changeset
|
115 vendor="David Barts <n5jrn@me.com>" |
8aa2dfac27eb
Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
25
diff
changeset
|
116 copyright="© MMXX, David W. Barts"/> |
25 | 117 <fx:resources> |
118 <fx:fileset dir="${basedir}" includes="${lc.app.name}.jar"/> | |
119 </fx:resources> | |
120 <fx:bundleArgument arg="runtime" value="${env.JRE_HOME}"/> | |
23 | 121 <args/> |
25 | 122 </fx:deploy> |
123 </sequential> | |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
124 </macrodef> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
125 |
25 | 126 <target name="macapp" depends="jar" description="Create MacOS app bundle."> |
127 <bundle type="image"> | |
23 | 128 <args> |
25 | 129 <fx:bundleArgument arg="jvmOptions" value="-Xdock:name=${app.name}"/> |
23 | 130 </args> |
131 </bundle> | |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
132 </target> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
133 |
25 | 134 <target name="app" depends="jar" description="Create app bundle."> |
135 <bundle type="image"/> | |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
136 </target> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
137 |
25 | 138 <target name="rpm" depends="jar" description="Create RPM package."> |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
139 <bundle type="rpm"/> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
140 </target> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
141 |
25 | 142 <target name="deb" depends="jar" description="Create Debian package."> |
22
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
143 <bundle type="deb"/> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
144 </target> |
829769cb1c13
Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
145 |
0
be282c48010a
Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
146 </project> |