aschearer / shade
- Source
- Commits
- Network (17)
- Issues (0)
- Downloads (0)
- Wiki (13)
- Graphs
-
Tree:
a0aea49
shade / build.xml
| 7078afe7 » | aschearer | 2008-09-18 | 1 | <?xml version="1.0" ?> | |
| 2 | |||||
| 9db3e18c » | aschearer | 2008-09-19 | 3 | <!-- | |
| 4 | |||||
| 5 | Shade build file. | ||||
| 6 | |||||
| a0aea49b » | aschearer | 2008-09-22 | 7 | ant setup Initialize Shade environment. | |
| 9db3e18c » | aschearer | 2008-09-19 | 8 | ant build Run to compile the code. | |
| 9 | ant run Run to launch Shade (should be run after ant build...) | ||||
| b400dd2a » | aschearer | 2008-09-20 | 10 | ant webstart Deploy shade as a webstart. | |
| a0aea49b » | aschearer | 2008-09-22 | 11 | ant clean Removes products of the build process, etc. | |
| 9db3e18c » | aschearer | 2008-09-19 | 12 | ||
| 13 | Alex Schearer | ||||
| 7078afe7 » | aschearer | 2008-09-18 | 14 | --> | |
| a0aea49b » | aschearer | 2008-09-22 | 15 | <project name="Shade"> | |
| 9db3e18c » | aschearer | 2008-09-19 | 16 | ||
| b400dd2a » | aschearer | 2008-09-20 | 17 | <property name="src.dir" value="src" /> | |
| 18 | <property name="res.dir" value="res" /> | ||||
| 9db3e18c » | aschearer | 2008-09-19 | 19 | <property name="lib.dir" value="lib" /> | |
| 20 | <property name="obj.dir" value="bin" /> | ||||
| 21 | <property name="target.dir" value="." /> | ||||
| b400dd2a » | aschearer | 2008-09-20 | 22 | <property name="script.dir" value="script" /> | |
| 23 | <property name="webstart.dir" value="${target.dir}/webstart" /> | ||||
| 24 | |||||
| 25 | <!-- Set up the Shade environment including preparing the natives. --> | ||||
| ed321a66 » | aschearer | 2008-09-20 | 26 | <target name="setup" depends="check-setup" unless="setup.exists"> | |
| b400dd2a » | aschearer | 2008-09-20 | 27 | <delete dir="${lib.dir}/natives" /> | |
| 28 | <mkdir dir="${lib.dir}/natives" /> | ||||
| 29 | <unzip src="${lib.dir}/natives-win32.jar" dest="${lib.dir}/natives" /> | ||||
| 30 | <unzip src="${lib.dir}/natives-mac.jar" dest="${lib.dir}/natives" /> | ||||
| 31 | <unzip src="${lib.dir}/natives-linux.jar" dest="${lib.dir}/natives" /> | ||||
| 32 | </target> | ||||
| 9db3e18c » | aschearer | 2008-09-19 | 33 | ||
| 34 | <!-- Compile and archive Shade. --> | ||||
| 35 | <target name="build"> | ||||
| 36 | <antcall target="compile" /> | ||||
| 37 | <antcall target="archive" /> | ||||
| 38 | </target> | ||||
| 39 | |||||
| 40 | <!-- Run Shade. --> | ||||
| ed321a66 » | aschearer | 2008-09-20 | 41 | <target name="run" depends="setup,build"> | |
| 9db3e18c » | aschearer | 2008-09-19 | 42 | <java jar="${target.dir}/shade.jar" fork="true" failonerror="true"> | |
| 43 | <jvmarg value="-Djava.library.path=lib/natives" /> | ||||
| 44 | </java> | ||||
| 45 | </target> | ||||
| 46 | |||||
| b400dd2a » | aschearer | 2008-09-20 | 47 | <!-- Clean up the environment. --> | |
| 48 | <target name="clean"> | ||||
| 49 | <delete dir="${obj.dir}" /> | ||||
| 50 | <delete file="${target.dir}/shade.jar" /> | ||||
| 51 | <delete dir="${webstart.dir}" /> | ||||
| 52 | </target> | ||||
| 53 | |||||
| 54 | <!-- Create a webstart directory in order to deploy Shade. --> | ||||
| ed321a66 » | aschearer | 2008-09-20 | 55 | <target name="webstart" depends="build"> | |
| 56 | <input message="Web server url:" addproperty="codebase" /> | ||||
| b400dd2a » | aschearer | 2008-09-20 | 57 | <delete dir="${webstart.dir}" /> | |
| 58 | <mkdir dir="${webstart.dir}" /> | ||||
| 59 | <copy file="${script.dir}/htaccess" tofile="${webstart.dir}/.htaccess" /> | ||||
| 60 | <copy file="${target.dir}/shade.jar" tofile="${webstart.dir}/shade.jar" /> | ||||
| 61 | <copy file="${script.dir}/template.jnlp" tofile="${webstart.dir}/shade.jnlp"> | ||||
| 62 | <filterchain> | ||||
| 63 | <replacetokens> | ||||
| 64 | <token key="codebase" value="${codebase}" /> | ||||
| 65 | </replacetokens> | ||||
| 66 | </filterchain> | ||||
| 67 | </copy> | ||||
| 68 | <antcall target="signjar" /> | ||||
| 69 | </target> | ||||
| 70 | |||||
| ed321a66 » | aschearer | 2008-09-20 | 71 | <!-- Determines whether setup has been run. --> | |
| 72 | <target name="check-setup"> | ||||
| 73 | <condition property="setup.exists"> | ||||
| 74 | <available file="${lib.dir}/natives" type="dir" /> | ||||
| 75 | </condition> | ||||
| 76 | </target> | ||||
| 77 | |||||
| 78 | |||||
| 79 | <!-- Determines whether a keystore exists. --> | ||||
| b400dd2a » | aschearer | 2008-09-20 | 80 | <target name="check-keystore"> | |
| 81 | <input message="Username:" addproperty="keystore.alias" /> | ||||
| 82 | <input message="Password:" addproperty="keystore.pass" /> | ||||
| 83 | <condition property="keystore.exists"> | ||||
| 84 | <available file="${target.dir}/${keystore.alias}.ks" type="file" /> | ||||
| 85 | </condition> | ||||
| 86 | </target> | ||||
| 87 | |||||
| 88 | <!-- Create a key store. --> | ||||
| 89 | <target name="keystore" depends="check-keystore" unless="keystore.exists"> | ||||
| 90 | <input message="Full Name:" addproperty="keystore.name" /> | ||||
| 91 | <input message="Company:" addproperty="keystore.company" /> | ||||
| 92 | |||||
| 93 | <genkey keystore="${target.dir}/${keystore.alias}.ks" | ||||
| 94 | alias="${keystore.alias}" | ||||
| 95 | storepass="${keystore.pass}"> | ||||
| 96 | <dname> | ||||
| 97 | <param name="CN" value="${keystore.name}" /> | ||||
| 98 | <param name="OU" value="${keystore.company}" /> | ||||
| 99 | <param name="O" value="" /> | ||||
| 100 | <param name="C" value=""/> | ||||
| 101 | </dname> | ||||
| 102 | </genkey> | ||||
| 103 | </target> | ||||
| 104 | |||||
| 105 | <!-- Sign's webstart/shade.jar for deployment. --> | ||||
| 106 | <target name="signjar" depends="check-keystore"> | ||||
| 107 | <signjar jar="${webstart.dir}/shade.jar" | ||||
| 108 | keystore="${target.dir}/${keystore.alias}.ks" | ||||
| 109 | storepass="${keystore.pass}" | ||||
| 110 | alias="${keystore.alias}" /> | ||||
| 111 | </target> | ||||
| 112 | |||||
| 9db3e18c » | aschearer | 2008-09-19 | 113 | <!-- Compile the code put results into obj.dir. --> | |
| 114 | <target name="compile"> | ||||
| 115 | <mkdir dir="${obj.dir}" /> | ||||
| 116 | <javac destdir="${obj.dir}" debug="on"> | ||||
| 117 | <src path="${src.dir}" /> | ||||
| 118 | <classpath> | ||||
| 119 | <pathelement path="${lib.dir}/slick.jar" /> | ||||
| 120 | </classpath> | ||||
| 121 | </javac> | ||||
| 122 | </target> | ||||
| 123 | |||||
| 124 | <!-- Jar compiled code and place result into target.dir. --> | ||||
| 125 | <target name="archive"> | ||||
| 126 | <jar destfile="${target.dir}/shade.jar" manifest="manifest.txt"> | ||||
| 127 | <fileset dir="${obj.dir}" /> | ||||
| 128 | <fileset dir="${res.dir}" /> | ||||
| 129 | </jar> | ||||
| 7078afe7 » | aschearer | 2008-09-18 | 130 | </target> | |
| 131 | |||||
| 132 | </project> | ||||
