Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ryohang/3056035 to your computer and use it in GitHub Desktop.
Save ryohang/3056035 to your computer and use it in GitHub Desktop.
A maven pom file for the project
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>StaticContent</artifactId>
<packaging>jar</packaging>
<name>StaticContent</name>
<version>${version.properties}</version>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>portal-js-location</id>
<phase>initialize</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<mkdir dir="${basedir}/target/output/jmvc/portal" />
<echo file="${basedir}/target/output/jmvc/portal/production.js" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>portal-compress</id>
<phase>process-classes</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./js</executable>
<workingDirectory>src/main/jmvc</workingDirectory>
<arguments>
<argument>portal/scripts/compress.js</argument>
<argument>${basedir}/target/output/jmvc/portal</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>portal-test</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>funcunit/envjs</executable>
<workingDirectory>src/main/jmvc</workingDirectory>
<arguments>
<argument>portal/qunit.html</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>move-production-js-to-classes</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${basedir}/target/classes">
<fileset dir="${basedir}/target/output/" />
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/jmvc</directory>
<filtering>false</filtering>
<includes>
<include>**/engines/**</include>
<include>**/jmvc/**</include>
<include>**/jquery/**</include>
<include>**/steal/**</include>
<include>**/*.css</include>
<include>**/*.jpg</include>
<include>**/*.png</include>
<include>**/*.xml</include>
<include>portal/index.html</include>
</includes>
<targetPath>jmvc</targetPath>
</resource>
<resource>
<directory>src/main/jmvc/stylesheets</directory>
<filtering>false</filtering>
<includes>
<include>*.css</include>
</includes>
<targetPath>jmvc/portal/stylesheets</targetPath>
</resource>
</resources>
</build>
</project>
diff --git build/build.js build/build.js
index 76ae198..87e4629 100644
--- build/build.js
+++ build/build.js
@@ -223,6 +223,7 @@ steal(function( steal ) {
}
// get envjs
load('steal/rhino/env.js'); //reload every time
+ var success = true;
// open the url
Envjs(url, {
scriptTypes: {
@@ -241,8 +242,14 @@ steal(function( steal ) {
},
afterInlineScriptLoad: function( script ) {
scripts.push(script);
+ },
+ onScriptLoadError: function(script) {
+ success = false;
}
});
+ if (!success) {
+ java.lang.System.exit(-1);
+ }
// set back steal
newSteal = window.steal;
@@ -286,4 +293,4 @@ steal(function( steal ) {
};
};
-});
\ No newline at end of file
+});
diff --git js.bat js.bat
index 761e15e..6f8d0ad 100644
--- js.bat
+++ js.bat
@@ -58,3 +58,4 @@ echo js apps/[NAME]/compress.js Compress your application and generate documenta
:END
+exit %errorlevel%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment