Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add spring-js-resources to Gradle build

  • Loading branch information...
commit 4146871862edb1bde355746923d0e0dde85d26cf 1 parent 50a1cf1
@rstoyanchev rstoyanchev authored
View
64 build.gradle
@@ -8,20 +8,18 @@ buildscript {
dependencies {
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.3'
}
-
- project.ext {
- springVersion = '3.1.1.RELEASE'
- springSecurityVersion = '3.0.7.RELEASE'
- slf4jVersion = '1.6.1'
- log4jVersion = '1.2.15'
- }
}
configure(allprojects) {
- apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
+}
+
+configure(subprojects) { subproject ->
+
+ apply plugin: 'java'
+ apply from: "${rootProject.projectDir}/publish-maven.gradle"
group = 'org.springframework.webflow'
@@ -32,25 +30,10 @@ configure(allprojects) {
sourceSets.test.resources.srcDirs = ['src/main/java', 'src/test/resources', 'src/test/java']
- test {
- systemProperty("java.awt.headless", "true")
- include '**/*Tests.class'
- }
-
repositories {
maven { url "http://repo.springsource.org/libs-release" }
}
- dependencies {
- testCompile "junit:junit:3.8.2"
- testCompile "org.easymock:easymock:2.5.1"
- }
-}
-
-configure(subprojects) { subproject ->
-
- apply from: "${rootProject.projectDir}/publish-maven.gradle"
-
jar {
manifest.attributes['Implementation-Title'] = subproject.name
manifest.attributes['Implementation-Version'] = subproject.version
@@ -62,6 +45,26 @@ configure(subprojects) { subproject ->
expand(copyright: new Date().format('yyyy'), version: project.version)
}
}
+}
+
+configure(subprojects.findAll {it.name != 'spring-js-resources'}) { subproject ->
+
+ dependencies {
+ testCompile "junit:junit:3.8.2"
+ testCompile "org.easymock:easymock:2.5.1"
+ }
+
+ subproject.ext {
+ springVersion = '3.1.1.RELEASE'
+ springSecurityVersion = '3.0.7.RELEASE'
+ slf4jVersion = '1.6.1'
+ log4jVersion = '1.2.15'
+ }
+
+ test {
+ systemProperty("java.awt.headless", "true")
+ include '**/*Tests.class'
+ }
javadoc {
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
@@ -110,15 +113,24 @@ project('spring-binding') {
}
}
+project('spring-js-resources') {
+
+ description = 'Spring JS Resources'
+
+ apply from: "spring-js-resources.gradle"
+
+ jar {
+ dependsOn prepareResources
+ }
+}
+
project('spring-js') {
description = 'Spring JS'
dependencies {
- // depend on spring-js-resources in order to have it show up as a
- // <dependency> in the generated pom
- // compile project(":spring-js-resources")
+ compile project(":spring-js-resources")
compile "commons-logging:commons-logging:1.1.1"
compile("javax.servlet:servlet-api:2.5", provided)
View
23 build.properties
@@ -1,23 +0,0 @@
-version=2.4.0
-release.type=integration
-natural.name=spring-webflow
-project.key=SWF
-ivy.cache.dir=${basedir}/../ivy-cache
-integration.repo.dir=${basedir}/../integration-repo
-source.version=1.5
-javadoc.exclude.package.names=org/springframework/webflow/samples/**
-javadoc.max.memory=256M
-test.vm.args=-Xmx1024M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError
-ivy.settings.file=${basedir}/../build-spring-webflow/ivysettings.xml
-
-# For when releasing
-#release.type=release
-#build.stamp=RELEASE
-
-# For when releasing milestones
-#release.type=milestone
-#build.stamp=M1
-
-# For development in trunk
-#release.type=integration
-
View
2  settings.gradle
@@ -3,6 +3,6 @@ rootProject.name = 'webflow'
include 'spring-binding'
include 'spring-faces'
include 'spring-js'
-// include 'spring-js-resources'
+include 'spring-js-resources'
include 'spring-webflow'
View
68 settings.xml
@@ -1,68 +0,0 @@
-<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
- <profiles>
- <profile>
- <id>fast</id>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- </properties>
- </profile>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <repositories>
- <!-- Maven Central -->
- <repository>
- <id>org.maven.central</id>
- <name>Maven Central Repository</name>
- <url>http://repo1.maven.org/maven2</url>
- <snapshots><enabled>false</enabled></snapshots>
- </repository>
- <!-- Spring snapshots -->
- <repository>
- <id>org.springframework.maven.snapshot</id>
- <name>Spring Maven Snapshot Repository</name>
- <url>http://maven.springframework.org/snapshot</url>
- <releases><enabled>false</enabled></releases>
- <snapshots><enabled>true</enabled></snapshots>
- </repository>
- <!-- Spring milestones -->
- <repository>
- <id>org.springframework.maven.milestone</id>
- <name>Spring Maven Milestone Repository</name>
- <url>http://maven.springframework.org/milestone</url>
- <snapshots><enabled>false</enabled></snapshots>
- </repository>
- <!-- Hibernate, RichFaces -->
- <repository>
- <id>org.jboss.repository</id>
- <name>JBoss Maven Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- <snapshots><enabled>false</enabled></snapshots>
- </repository>
- <!-- Sun Mojarra JSF 2.x -->
- <repository>
- <id>java.net.release</id>
- <name>Repository for Projects On Hosted on java.net</name>
- <url>http://download.java.net/maven/2</url>
- </repository>
- <!-- Sun Mojarra JSF 1.x, Facelets -->
- <repository>
- <id>maven1.java.net</id>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- <!-- PrimeFaces -->
- <repository>
- <id>primefaces</id>
- <name>Prime Technology Maven Repository</name>
- <url>http://repository.prime.com.tr</url>
- <layout>default</layout>
- </repository>
- </repositories>
- </profile>
- </profiles>
-</settings>
View
17 spring-binding/.project
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>spring-binding</name>
- <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
17 spring-faces/.project
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>spring-faces</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
17 spring-js-resources/.project
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>spring-js-resources</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
42 spring-js-resources/spring-js-resources.gradle
@@ -0,0 +1,42 @@
+configurations {
+ shrinksafe
+}
+
+dependencies {
+ shrinksafe "org.dojotoolkit:dojo-shrinksafe:1.7.2"
+}
+
+task prepareResources(type: Jar) { jar ->
+ doLast() {
+ minify("Spring.js")
+ minify("Spring-Dojo.js")
+ ant.unzip(src: "${projectDir}/dojo-build/dojo-build.zip",
+ dest: "${buildDir}/resources/main/META-INF/web-resources")
+ }
+}
+
+void minify(fileName) {
+
+ project.ant {
+ def sourceDir = "${basedir}/src/main/resources/META-INF/web-resources/spring/"
+ def outputDir = "${buildDir}/resources/main/META-INF/web-resources/spring/"
+
+ copy(file: "${outputDir}/${fileName}", tofile: "${outputDir}/${fileName}.uncompressed.js")
+
+ java(classname: "org.dojotoolkit.shrinksafe.Main",
+ classpath: configurations.shrinksafe.asPath, fork: true,
+ output: "${outputDir}/${fileName}.TMP.js") {
+ arg(value: "${sourceDir}/${fileName}")
+ }
+
+ move(file: "${outputDir}/${fileName}.TMP.js", toFile: "${outputDir}/${fileName}") {
+ filterchain {
+ filterreader(classname: "org.apache.tools.ant.filters.StripLineBreaks")
+ }
+ filterchain {
+ concatfilter(prepend: "${basedir}/../src/dist/javascript-copyright.txt")
+ }
+ }
+ }
+}
+
View
17 spring-js/.project
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>spring-js</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
17 spring-webflow/.project
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>spring-webflow</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
Please sign in to comment.
Something went wrong with that request. Please try again.