1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
|
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project name="build installers" default="build" basedir=".">
<property file="${basedir}/build.properties"/>
<property file="${basedir}/custom.properties"/>
<target name="build" depends="init,-build,-generate-bundles,post-build"/>
<target name="init" depends="-clean,-checkout,-init,-init-properties,-post-init-clean"/>
<target name="-clean-cvs" unless="no.checkout">
<delete dir="${nbi.all.dir}"/>
</target>
<target name="-clean" depends="-clean-cvs" unless="no.clean">
<delete dir="${output.dir}"/>
<delete dir="${nbi.ext.dir}/products/helloworld/build"/>
<delete dir="${nbi.ext.dir}/products/helloworld/dist"/>
<delete dir="${nbi.ext.dir}/engine/build"/>
<delete dir="${nbi.ext.dir}/engine/dist"/>
<!--<delete dir="${basedir}/cache"/>-->
</target>
<target name="post-build">
<delete dir="${output.dir}/registry-temp"/>
</target>
<target name="-checkout">
<copy todir="${nbi.all.dir}/.common">
<fileset dir="${basedir}/.common"/>
</copy>
<copy todir="${nbi.ext.dir}">
<fileset dir="${basedir}/ext">
</fileset>
</copy>
</target>
<target name="-init">
<taskdef
name="if"
classpath="${custom.tasks.cls}"
classname="org.netbeans.installer.infra.build.ant.If"/>
<taskdef
name="for-each"
classpath="${custom.tasks.cls}"
classname="org.netbeans.installer.infra.build.ant.ForEach"/>
<taskdef
name="set"
classpath="${custom.tasks.cls}"
classname="org.netbeans.installer.infra.build.ant.SetProperty"/>
<taskdef
name="create-bundle"
classpath="${custom.tasks.cls}"
classname="org.netbeans.installer.infra.build.ant.registries.CreateBundle"/>
<delete file="${temp.file}"/>
</target>
<target name="-init-properties">
<echo file="${nbi.all.dir}/environment.tmp" encoding="utf-8">
checkout.sources=false
sources.dir=${nbi.all.dir}
cvs.module=ext
release.to.server=false
release.registry.dir=${output.dir}/registry-temp
dont.build.custom.tasks=true
custom.tasks.cls=${custom.tasks.cls}
build.engine=false
engine.dist.file.name=nbi-engine.jar
engine.dist.file=${nbi.core.dir}/infra/build/engine/dist/nbi-engine.jar
packaged.data.dir=${basedir}/cache/packaged
downloads.cache.dir=${basedir}/cache/raw
jarsigner.enabled=${jarsigner.enabled}
</echo>
<replace file="${nbi.all.dir}/environment.tmp" token="\" value="/" encoding="utf-8"/>
<native2ascii src="${nbi.all.dir}" dest="${nbi.all.dir}" encoding="utf-8" includes="environment.tmp" ext=".properties"/>
</target>
<target name="-post-init-clean">
<delete dir="${basedir}/cache/raw"/>
</target>
<target name="-build">
<delete dir="${output.dir}"/>
<mkdir dir="${output.dir}"/>
<mkdir dir="${bundles.release.dir}"/>
<mkdir dir="${output.dir}/components"/>
<property name="engine.dist.file.name" value="nbi-engine.jar"/>
<echo message="BUILDING HELLOWORLD EXT ENGINE =================================="/>
<ant dir="${nbi.ext.dir}/infra/build/engine" target="release-all">
<property
name="basedir"
value="${nbi.ext.dir}/infra/build/engine"/>
<property
name="environment.properties"
value="${environment.properties}"/>
<property
name="core.engine.dist.file"
value="${nbi.engine.jar}"/>
</ant>
<echo message="BUILDING HELLOWORLD PRODUCT =================================="/>
<ant dir="${nbi.ext.dir}/infra/build/products/helloworld" target="release-all">
<property
name="basedir"
value="${nbi.ext.dir}/infra/build/products/helloworld"/>
<property
name="environment.properties"
value="${environment.properties}"/>
<property
name="dist.dir"
value="${output.dir}/components"/>
<property
name="release.parent.uid"
value=""/>
<property
name="release.parent.version"
value=""/>
<property
name="release.parent.platforms"
value=""/>
<property
name="engine.dist.file"
value="${output.dir}/registry-temp/engine.jar"/>
</ant>
</target>
<target name="-generate-bundles">
<for-each property="platform" list="${target.platforms}" separator=" ">
<condition property="bundle.extention.${platform}" value="exe">
<contains string="${platform}" substring="windows"/>
</condition>
<condition property="bundle.extention.${platform}" value="sh">
<or>
<contains string="${platform}" substring="linux"/>
<contains string="${platform}" substring="solaris"/>
</or>
</condition>
<condition property="bundle.extention.${platform}" value="zip">
<contains string="${platform}" substring="macosx"/>
</condition>
<set property="bundle.extention" source="bundle.extention.${platform}"/>
<create-bundle root="${output.dir}/registry-temp"
platform="${platform}"
target="${bundles.release.dir}/${bundle.files.prefix}-${platform}.${bundle.extention}">
<component uid="${main.product.uid}" version="1.0.0.0.0"/>
</create-bundle>
<if property="bundle.extention" value="zip">
<antcall target="zip-to-tgz">
<param name="input.file" value="${bundles.release.dir}/${bundle.files.prefix}-${platform}.zip"/>
<param name="output.file" value="${bundles.release.dir}/${bundle.files.prefix}-${platform}.tgz"/>
</antcall>
<delete file="${bundles.release.dir}/${bundle.files.prefix}-${platform}.zip"/>
</if>
</for-each>
<echo>Installer(s) for [${target.platforms}] are available at ${bundles.release.dir}</echo>
</target>
<target name="zip-to-tgz">
<set property="tar.tmpdir"
value="${bundles.release.dir}/tempdir"/>
<mkdir dir="${tar.tmpdir}"/>
<unzip
src="${input.file}"
dest="${tar.tmpdir}"/>
<tar tarfile="${output.file}"
compression="gzip">
<tarfileset dir="${tar.tmpdir}" mode="644">
<include name="**/*.*"/>
<exclude name="**/executable"/>
</tarfileset>
<tarfileset dir="${tar.tmpdir}" mode="755">
<include name="**/executable"/>
</tarfileset>
</tar>
<delete dir="${tar.tmpdir}"/>
</target>
</project>
|