/* Gradle Build for justCheckers - Web --------------------------------------------- Author: Dorian Pula (dorian.pula@amber-penguin-software.ca) License: AGPL v3. Gradle docs: http://www.gradle.org/docs/current/userguide/userguide_single.html */ sourceCompatibility = 1.6 targetCompatibility = 1.6 // Description of the project description = 'justCheckers' version = '0.3' apply plugin: 'war' apply plugin: 'jetty' sourceCompatibility = 1.6 targetCompatibility = 1.6 // Description of the project description = 'justcheckers-web' version = '0.3' project.ext { appName = 'justcheckers-web' appBaseName = "justcheckers" hibernateVersion = '3.5.4-Final' slf4jVersion = '1.7.5' springVersion = '3.1.3.RELEASE' } // Setup build script repositories starting with Maven repositories repositories { maven { url 'http://repo1.maven.org/maven2' } } // Dependency management dependencies { compile project(':core') // Spring Framework + SLF4J compile ('org.springframework:spring-context:' + project.springVersion) { exclude module: 'commons-logging' } compile 'log4j:log4j:1.2.16' compile 'org.slf4j:jcl-over-slf4j:' + project.slf4jVersion compile 'org.slf4j:slf4j-api:' + project.slf4jVersion compile 'org.slf4j:slf4j-log4j12:' + project.slf4jVersion compile 'org.springframework:spring-jdbc:' + project.springVersion compile 'org.springframework:spring-orm:' + project.springVersion compile 'org.springframework:spring-webmvc:' + project.springVersion compile 'org.springframework:spring-parent:' + project.springVersion // xstream compile 'com.thoughtworks.xstream:xstream:1.4.4' // Hibernate + C3P0 compile 'org.hibernate:hibernate:' + project.hibernateVersion compile 'org.hibernate:hibernate-annotations:' + project.hibernateVersion compile 'org.hibernate:hibernate-c3p0:' + project.hibernateVersion compile 'javassist:javassist:3.9.0.GA' // FlexJson compile 'net.sf.flexjson:flexjson:2.1' // Javax Servlet and Mail APIs providedCompile 'javax.servlet:servlet-api:2.5' } // At the end of day we just need a JAR and a WAR. ext.sharedManifest = manifest { attributes( 'App-Name' : project.appName, 'App-Version' : version, 'Build-User' : System.properties['user.name'], 'Build-Time' : new Date().format('yyyy-MMMM-dd HH:mm:ss'), 'Build-OS' : System.properties['os.name'] + ' - version ' + System.properties['os.version'], 'Build-Sys' : System.properties['os.arch'], 'Java-Version' : System.properties['java.version'], 'Java-Vendor' : System.properties['java.vendor'], 'Java-VM' : System.properties['java.vm.vendor'] + ' ' + System.properties['java.vm.name'] + ' v' + System.properties['java.vm.version']) } // Build the JAR. jar { enabled = true includeEmptyDirs = false manifest = sharedManifest include '**/**.class' exclude 'build/**' } // Build WAR files that include the JAR file. Add the resources back in. war { from 'webapp' exclude 'WEB-INF/lib' classpath = project.configurations.runtime - project.configurations.providedRuntime + jar.outputs.files manifest = sharedManifest includeEmptyDirs = false into('WEB-INF/classes') { from sourceSets.main.resources } } jettyRun { httpPort = 8080 contextPath = project.appBaseName webAppSourceDirectory = new File('webapp') } // Run embedded Jetty setup. jettyRunWar { httpPort = 8080 contextPath = project.appBaseName }