build: only minify translations if js dir is found in application
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Aug 2016 09:40:21 +0000 (11:40 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Aug 2016 16:12:28 +0000 (18:12 +0200)
Change-Id: I763532c6d8b409cf5f91168d9b105b6f592247bc
Reviewed-on: http://gerrit.tine20.com/customers/3407
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/build.xml

index 0767b89..79644ee 100644 (file)
         </copy>
 
         <!-- translations -->
-        <translation-build appName="${name}" />
-        <jsMin targetDir="${builddir}/${name}/js" failOnError="false">
-            <fileset dir="${builddir}/${name}/js">
-                <include name="*-lang-*-debug.js"/>
-            </fileset>
-        </jsMin>
-
-        <copy toDir="${project.basedir}/${name}/js">
-            <fileset dir="${builddir}/${name}/js">
-                <include name="*-lang-*-debug.js" />
-            </fileset>
-        </copy>
-
-        <copy toDir="${project.basedir}/${name}/js">
-            <fileset dir="${builddir}/${name}/js">
-                <include name="*-lang-*-debug-min.js" />
-            </fileset>
-
-            <mapper type="regexp" from="^(.*)-debug-min.js" to="\1.js"/>
-        </copy>
-
+        <if>
+            <available file="${builddir}/${name}/js" type="dir" property="has_jsdir"/>
+            <then>
+                <echo message="Building translations..." />
+                <translation-build appName="${name}" />
+                <jsMin targetDir="${builddir}/${name}/js" failOnError="false">
+                    <fileset dir="${builddir}/${name}/js">
+                        <include name="*-lang-*-debug.js"/>
+                    </fileset>
+                </jsMin>
+
+                <copy toDir="${project.basedir}/${name}/js">
+                    <fileset dir="${builddir}/${name}/js">
+                        <include name="*-lang-*-debug.js" />
+                    </fileset>
+                </copy>
+
+                <copy toDir="${project.basedir}/${name}/js">
+                    <fileset dir="${builddir}/${name}/js">
+                        <include name="*-lang-*-debug-min.js" />
+                    </fileset>
+
+                    <mapper type="regexp" from="^(.*)-debug-min.js" to="\1.js"/>
+                </copy>
+            </then>
+        </if>
     </target>
 
     <!-- ============================================  -->