Fetching contributors…
Cannot retrieve contributors at this time
150 lines (127 sloc) 4.66 KB
/*
* build.gradle for iUI
* (c) 2012 by the iUI project members
*
* This file is used to run a local webserver for testing purposes and to
* publish to http://demo.iui-js.org on Google App Engine.
*
* iUI uses ant and build.xml to build the iUI distribution.
* (at some point in the future the build.xml functions may be migrated from
* ant to gradle)
*
* To run a local weberver use:
* ./gradlew gaeRun
*
* To publish to GAE run:
* ./gradlew gaeUpload
*
* If you're not an administrator for http://demo.iui-js.org, you'll need to configure
* your own instance of GAE -- instructions TBD.
*/
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'gae'
apply plugin: 'gaelyk'
apply plugin: 'eclipse'
apply plugin: 'idea'
def compatibilityVersion = 1.5
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-gae-plugin:0.7'
classpath 'org.gradle.api.plugins:gradle-gaelyk-plugin:0.3.2'
classpath 'eu.appsatori:gradle-fatjar-plugin:0.1.1'
}
}
repositories {
mavenCentral()
}
//sourceSets {
// main {
// output.classesDir = file('web-app/WEB-INF/classes')
// }
//}
dependencies {
def gaeVersion = '1.6.6'
groovy 'org.codehaus.groovy:groovy-all:1.8.6'
compile "com.google.appengine:appengine-api-1.0-sdk:$gaeVersion",
"com.google.appengine:appengine-api-labs:$gaeVersion",
'org.codehaus.groovy:groovy-all:1.8.6'
compile 'org.gaelyk:gaelyk:1.2'
/**
* To add binary plugin just declare it as a dependency. For example,
* uncomment following to add GPars support to your Gaelyk project.
* @see https://github.com/musketyr/gpars-appengine
*/
// compile 'org.codehaus.gpars:gpars-appengine:0.1'
testCompile 'org.gaelyk:gaelyk-spock:0.3.0.1'
testCompile "com.google.appengine:appengine-api-stubs:$gaeVersion",
"com.google.appengine:appengine-testing:$gaeVersion"
functionalTestCompile 'org.codehaus.geb:geb-spock:0.7.0',
'org.seleniumhq.selenium:selenium-firefox-driver:2.20.0'
gaeSdk "com.google.appengine:appengine-java-sdk:$gaeVersion"
}
//webAppDirName = file('web-app')
gae {
downloadSdk = true
warDir = file('web-app')
optimizeWar = true
// jvmFlags = ['-Dappengine.user.timezone=UTC']
}
gaeExplodeWar.dependsOn gaelykPrecompileGroovlet
gaeExplodeWar.dependsOn gaelykPrecompileTemplate
clean {
delete sourceSets*.output.classesDir
}
task copyRuntimeLibraries(type: Sync) {
def webAppLibDirName = 'web-app/WEB-INF/lib'
description = "Copies runtime libraries to $webAppLibDirName."
from configurations.runtime
into webAppLibDirName
}
gaeRun.dependsOn copyRuntimeLibraries
idea {
project {
jdkName = compatibilityVersion
ipr.withXml { provider ->
def node = provider.asNode()
// Set Gradle home
def gradleSettings = node.appendNode('component', [name: 'GradleSettings'])
gradleSettings.appendNode('option', [name: 'SDK_HOME', value: gradle.gradleHomeDir])
}
}
}
eclipse {
project {
name 'gaelyk-project'
file {
whenMerged { project ->
project.natures << 'com.google.appengine.eclipse.core.gaeNature'
project.natures << 'com.google.gdt.eclipse.core.webAppNature'
project.buildCommands << [name: 'com.google.appengine.eclipse.core.enhancerbuilder']
project.buildCommands << [name: 'com.google.appengine.eclipse.core.projectValidator']
project.buildCommands << [name: 'com.google.gdt.eclipse.core.webAppProjectValidator']
}
}
}
classpath {
file {
withXml { xml ->
xml.asNode().classpathentry.find { it.@kind == 'output' && it.@path == 'bin' }.@path = 'web-app/WEB-INF/classes'
xml.asNode().appendNode('classpathentry', [kind: 'con', path: 'com.google.appengine.eclipse.core.GAE_CONTAINER'])
.appendNode('attributes')
.appendNode('attribute', [name: 'org.eclipse.jst.component.nondependency', value: '/web-app/WEB-INF/lib'])
xml.asNode().appendNode('classpathentry', [exported: 'true', kind: 'con', path: 'GROOVY_SUPPORT'])
.appendNode('attributes')
.appendNode('attribute', [name: 'org.eclipse.jst.component.nondependency', value: '/web-app/WEB-INF/lib'])
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion '1.2'
}