Cross-platform HTML5 NotePost client, for use with NW.js on the desktop and Cordova on mobile.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  4. Copyright 1997-2012 Oracle and/or its affiliates. All rights reserved.
  5. Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  6. Other names may be trademarks of their respective owners.
  7. The contents of this file are subject to the terms of either the GNU
  8. General Public License Version 2 only ("GPL") or the Common
  9. Development and Distribution License("CDDL") (collectively, the
  10. "License"). You may not use this file except in compliance with the
  11. License. You can obtain a copy of the License at
  12. http://www.netbeans.org/cddl-gplv2.html
  13. or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  14. specific language governing permissions and limitations under the
  15. License. When distributing the software, include this License Header
  16. Notice in each file and include the License file at
  17. nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
  18. particular file as subject to the "Classpath" exception as provided
  19. by Oracle in the GPL Version 2 section of the License file that
  20. accompanied this code. If applicable, add the following below the
  21. License Header, with the fields enclosed by brackets [] replaced by
  22. your own identifying information:
  23. "Portions Copyrighted [year] [name of copyright owner]"
  24. Contributor(s):
  25. The Original Software is NetBeans. The Initial Developer of the Original
  26. Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  27. Microsystems, Inc. All Rights Reserved.
  28. If you wish your version of this file to be governed by only the CDDL
  29. or only the GPL Version 2, indicate your decision by adding
  30. "[Contributor] elects to include this software in this distribution
  31. under the [CDDL or GPL Version 2] license." If you do not indicate a
  32. single choice of license, a recipient has the option to distribute
  33. your version of this file under either the CDDL, the GPL Version 2 or
  34. to extend the choice of license to its licensees as provided above.
  35. However, if you add GPL Version 2 code and therefore, elected the GPL
  36. Version 2 license, then the option applies only if the new code is
  37. made subject to such option by the copyright holder.
  38. -->
  39. <!--
  40. Generated file; DO NOT EDIT.
  41. -->
  42. <project name="NotePostApp" basedir="..">
  43. <property file="nbproject/configs/${config}.properties" />
  44. <scriptdef name="checkVersion" language="javascript">
  45. <attribute name="first" />
  46. <attribute name="property" />
  47. <![CDATA[
  48. var first = attributes.get("first");
  49. if (first >= "3.0.0") {
  50. project.setProperty(attributes.get("property"), true);
  51. }
  52. ]]>
  53. </scriptdef>
  54. <scriptdef name="forDevice" language="javascript">
  55. <![CDATA[
  56. var dev = project.getProperty("device");
  57. if (dev == "device") {
  58. project.setProperty("build.for.device", true);
  59. }
  60. ]]>
  61. </scriptdef>
  62. <target name="check-cordova-project">
  63. <condition property="cordova.project">
  64. <or>
  65. <available file=".cordova"/>
  66. <available file="hooks"/>
  67. </or>
  68. </condition>
  69. </target>
  70. <target name="upgrade-to-cordova-project" depends="check-cordova-project,check-cordova-version" unless="cordova.project">
  71. <echo level="info" message="${cordova.command} -d create ${java.io.tmpdir}/nb_temp_project com.coolappz.${project.name} ${project.name}" />
  72. <delete dir="${java.io.tmpdir}/nb_temp_project"/>
  73. <exec executable="${cordova.command}" resolveexecutable="true" searchpath="true" failonerror="true" >
  74. <env key="${cordova.path.key}" path="${cordova.path.value}:${android.sdk.home}/tools:${android.sdk.home}/platform-tools:${jdk.home}/bin:${ant.home}/bin:${jdk.home}/bin"/>
  75. <env key="JAVA_HOME" path="${jdk.home}"/>
  76. <arg value="-d"/>
  77. <arg value="create"/>
  78. <arg value="${java.io.tmpdir}/nb_temp_project"/>
  79. <arg value="com.coolappz.${project.name}"/>
  80. <arg value="${project.name}" />
  81. </exec>
  82. <copy todir="." overwrite="true" failonerror="false">
  83. <fileset dir="${java.io.tmpdir}/nb_temp_project"/>
  84. </copy>
  85. <delete dir="${java.io.tmpdir}/nb_temp_project"/>
  86. <delete dir="www"/>
  87. <copy todir="www" failonerror="false" quiet="true" >
  88. <fileset dir="${site.root}"/>
  89. </copy>
  90. </target>
  91. <target name="create-hello-world" depends="check-cordova-version">
  92. <echo level="info" message="${cordova.command} -d create www_nb_temp com.coolappz.${project.name} ${project.name}" />
  93. <exec executable="${cordova.command}" resolveexecutable="true" searchpath="true" failonerror="true">
  94. <env key="${cordova.path.key}" path="${cordova.path.value}:${android.sdk.home}/tools:${android.sdk.home}/platform-tools:${jdk.home}/bin:${ant.home}/bin:${jdk.home}/bin"/>
  95. <env key="JAVA_HOME" path="${jdk.home}"/>
  96. <arg value="-d"/>
  97. <arg value="create"/>
  98. <arg value="www_nb_temp"/>
  99. <arg value="com.coolappz.${project.name}"/>
  100. <arg value="${project.name}" />
  101. </exec>
  102. <delete dir="www"/>
  103. <mkdir dir="www"/>
  104. <move file="www_nb_temp/www" tofile="www"/>
  105. <delete dir="www_nb_temp"/>
  106. <delete file="www/config.xml"/>
  107. </target>
  108. <taskdef
  109. classname="org.netbeans.modules.cordova.updatetask.ReadConfigTask"
  110. classpath="${update.task.jar}"
  111. name="readconfig"/>
  112. <taskdef
  113. classname="org.netbeans.modules.cordova.updatetask.PluginTask"
  114. classpath="${update.task.jar}"
  115. name="plugintask"/>
  116. <target name="check-cordova-version">
  117. <property environment="env"/>
  118. <checkVersion first="${cordova.version}" property="cordova.ver.3"/>
  119. <fail message="Cordova version 3 or greater required." unless="cordova.ver.3"/>
  120. <readconfig/>
  121. <forDevice/>
  122. </target>
  123. <target name="check-android-template">
  124. <available file="platforms/android" property="android.generated.exists"/>
  125. </target>
  126. <target name="check-ios-template">
  127. <available file="platforms/ios" property="ios.generated.exists"/>
  128. </target>
  129. <target name="create-android" depends="check-android-template,check-cordova-version,upgrade-to-cordova-project" unless="android.generated.exists">
  130. <echo level="info" message="${cordova.command} -d platform add android"/>
  131. <exec executable="${cordova.command}" resolveexecutable="true" searchpath="true" failonerror="true">
  132. <env key="${cordova.path.key}" path="${cordova.path.value}:${android.sdk.home}/tools:${android.sdk.home}/platform-tools:${jdk.home}/bin:${ant.home}/bin:${jdk.home}/bin"/>
  133. <env key="JAVA_HOME" path="${jdk.home}"/>
  134. <arg value="-d"/>
  135. <arg value="platform"/>
  136. <arg value="add"/>
  137. <arg value="android"/>
  138. </exec>
  139. </target>
  140. <target name="create-ios" depends="check-ios-template,check-cordova-version,upgrade-to-cordova-project" unless="ios.generated.exists">
  141. <echo level="info" message="${cordova.command} -d platform add ios"/>
  142. <exec executable="${cordova.command}" resolveexecutable="true" searchpath="true" dir="." failonerror="true">
  143. <env key="${cordova.path.key}" path="${cordova.path.value}:${android.sdk.home}/tools:${android.sdk.home}/platform-tools:${jdk.home}/bin:${ant.home}/bin:${jdk.home}/bin"/>
  144. <env key="JAVA_HOME" path="${jdk.home}"/>
  145. <arg value="-d"/>
  146. <arg value="platform"/>
  147. <arg value="add"/>
  148. <arg value="ios"/>
  149. </exec>
  150. </target>
  151. <target name="rebuild-ios" depends="clean-ios,build-ios"/>
  152. <target name="build-ios" depends="create-ios,update-plugins,update-ios,build-ios-xcodebuild,build-ios-ipa"/>
  153. <target name="build-ios-xcodebuild">
  154. <property name="path" location="platforms/ios/build"/>
  155. <exec executable="xcodebuild" dir="platforms/ios" failonerror="true">
  156. <arg value="-project"/>
  157. <arg value="${project.name}.xcodeproj"/>
  158. <arg value="ARCHS=${ios.build.arch}"/>
  159. <arg value="-target"/>
  160. <arg value="${project.name}"/>
  161. <arg value="-configuration"/>
  162. <arg value="Release"/>
  163. <arg value="-sdk"/>
  164. <arg value="${ios.build.sdk}" />
  165. <arg value="build"/>
  166. <arg value="CONFIGURATION_BUILD_DIR=${path}"/>
  167. </exec>
  168. </target>
  169. <target name="build-ios-ipa" if="build.for.device">
  170. <exec executable="xcrun" dir="platforms/ios/build" failonerror="true">
  171. <env key="CODESIGN_ALLOCATE" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate" />
  172. <arg value="-sdk"/>
  173. <arg value="${ios.build.sdk}" />
  174. <arg value="PackageApplication"/>
  175. <arg value="-v"/>
  176. <arg value="${project.name}.app"/>
  177. <arg value="-o"/>
  178. <arg value="${basedir}/platforms/ios/build/${project.name}.ipa"/>
  179. <arg value="--sign"/>
  180. <arg value="${ios.certificate.name}"/>
  181. <arg value="--embed"/>
  182. <arg value="${ios.provisioning.profile}"/>
  183. </exec>
  184. <available file="${basedir}/platforms/ios/build/${project.name}.ipa" property="ipa.found"/>
  185. <fail unless="ipa.found" message="PackageApplication failed."/>
  186. </target>
  187. <target name="sim-ios" depends="build-ios,ios-run-device,ios-run-simulator">
  188. </target>
  189. <target name="ios-run-device" if="build.for.device">
  190. <echo>
  191. Install "${basedir}/platforms/ios/build/${project.name}.ipa" through iTunes and run it.
  192. </echo>
  193. <exec executable="open" failonerror="true">
  194. <arg value="${basedir}/platforms/ios/build/${project.name}.ipa"/>
  195. </exec>
  196. </target>
  197. <target name="ios-run-simulator" unless="build.for.device">
  198. <exec executable="killall" dir="platforms/ios/build">
  199. <arg value="launchd_sim"/>
  200. </exec>
  201. <exec executable="${ios.sim.exec}" dir="platforms/ios/build">
  202. <arg line="launch ${project.name}.app ${ios.device.args} --exit"/>
  203. </exec>
  204. </target>
  205. <target name="update-plugins">
  206. <plugintask/>
  207. </target>
  208. <target name="update-android">
  209. <echo level="info" message="${cordova.command} prepare android"/>
  210. <exec executable="${cordova.command}" resolveexecutable="true" searchpath="true" failonerror="true">
  211. <env key="${cordova.path.key}" path="${cordova.path.value}:${android.sdk.home}/tools:${android.sdk.home}/platform-tools:${jdk.home}/bin:${ant.home}/bin:${jdk.home}/bin"/>
  212. <env key="JAVA_HOME" path="${jdk.home}"/>
  213. <arg value="prepare"/>
  214. <arg value="android"/>
  215. </exec>
  216. </target>
  217. <target name="update-ios">
  218. <echo level="info" message="${cordova.command} prepare ios"/>
  219. <exec executable="${cordova.command}" resolveexecutable="true" searchpath="true" failonerror="true">
  220. <env key="${cordova.path.key}" path="${cordova.path.value}:${android.sdk.home}/tools:${android.sdk.home}/platform-tools:${jdk.home}/bin:${ant.home}/bin:${jdk.home}/bin"/>
  221. <env key="JAVA_HOME" path="${jdk.home}"/>
  222. <arg value="prepare"/>
  223. <arg value="ios"/>
  224. </exec>
  225. </target>
  226. <target name="rebuild-android" depends="clean-android,build-android"/>
  227. <target name="build-android" depends="create-android,update-plugins">
  228. <echo level="info" message="${cordova.command} -d build android"/>
  229. <exec executable="${cordova.command}" resolveexecutable="true" searchpath="true" failonerror="true">
  230. <env key="${cordova.path.key}" path="${cordova.path.value}:${android.sdk.home}/tools:${android.sdk.home}/platform-tools:${jdk.home}/bin:${ant.home}/bin:${jdk.home}/bin"/>
  231. <env key="JAVA_HOME" path="${jdk.home}"/>
  232. <arg value="-d"/>
  233. <arg value="build"/>
  234. <arg value="android"/>
  235. </exec>
  236. </target>
  237. <target name="sim-android" depends="create-android,update-plugins">
  238. <echo level="info" message="${cordova.command} -d ${android.target.device.arg} android"/>
  239. <exec executable="${cordova.command}" resolveexecutable="true" searchpath="true" failonerror="true">
  240. <env key="${cordova.path.key}" path="${cordova.path.value}:${android.sdk.home}/tools:${android.sdk.home}/platform-tools:${jdk.home}/bin:${ant.home}/bin:${jdk.home}/bin"/>
  241. <env key="JAVA_HOME" path="${jdk.home}"/>
  242. <arg value="-d"/>
  243. <arg value="${android.target.device.arg}"/>
  244. <arg value="android"/>
  245. </exec>
  246. </target>
  247. <target name="clean-android" depends="check-android-template" if="android.generated.exists">
  248. <exec executable="./gradlew" dir="platforms/android">
  249. <arg value="clean" />
  250. </exec>
  251. </target>
  252. <target name="clean-ios" depends="check-ios-template" if="ios.generated.exists">
  253. <exec executable="platforms/ios/cordova/clean" />
  254. </target>
  255. </project>