datahub/web/build.gradle

124 lines
2.9 KiB
Groovy
Raw Normal View History

2015-11-19 14:39:21 -08:00
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'idea'
def findPlay20(){
project.ext.playHome = "${System.env.PLAY_HOME}"
project.ext.playExec = "${playHome}/play"
}
findPlay20()
repositories{
mavenCentral()
// Play framework manages its own dependencies in a local Ivy repo
ivy{
def repoDir = "${playHome}/repository/local/"
url repoDir
ivyPattern "${repoDir}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
artifactPattern "${repoDir}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
layout 'pattern'
}
jcenter()
maven {
name "typesafe-maven-release"
url "https://repo.typesafe.com/typesafe/maven-releases"
}
ivy {
name "typesafe-ivy-release"
url "https://repo.typesafe.com/typesafe/ivy-releases"
layout "ivy"
}
}
configurations{
//Configuration containing sbt generated .class files
//This is needed for IDEs, because they cannot compile
//play templates by themselves.
playManaged
//Libraries needed at compilation time but not to be
//exported as part of the distribution
provided
}
dependencies{
// User defined libraries (will be copied to lib/ before `play compile`)
// compile 'group:name:0.1'
compile externalDependency.play
compile externalDependency.play_java_jdbc
compile externalDependency.play_ebean
compile externalDependency.play_cache
compile externalDependency.spring_context
compile externalDependency.spring_jdbc
compile externalDependency.mockito
provided project(":wherehows-common")
// playManaged files('target/scala-2.9.1/classes_managed')
}
configurations {
all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
all*.exclude group: 'log4j', module: 'log4j'
}
clean {
delete "lib/"
}
2015-11-19 14:39:21 -08:00
task copyPlayLibs(type: Copy){
from configurations.provided
into 'lib'
}
task "playCompile" (type: Exec, dependsOn: copyPlayLibs) {
commandLine playExec, 'compile'
}
task "playClean" (type: Exec) {
commandLine playExec, 'clean'
}
sourceSets.main{
java.srcDir 'app'
compileClasspath += configurations.provided
}
// optional: if using 'idea' plugin
idea {
module{
scopes.COMPILE.plus += [configurations.playManaged]
scopes.PROVIDED.plus += [configurations.provided]
}
}
2016-03-15 12:02:54 -07:00
// delegate gradle java task to play command
task "build" (type: Exec, dependsOn: playClean, overwrite: true) {
2015-11-19 14:39:21 -08:00
commandLine playExec, 'stage'
}
2016-03-15 12:02:54 -07:00
task "assemble" (type: Exec, dependsOn: playClean, overwrite: true) {
commandLine playExec, 'stage'
}
2015-11-19 14:39:21 -08:00
2016-03-15 12:02:54 -07:00
task "dist" (type: Exec, overwrite: true) {
2015-11-19 14:39:21 -08:00
commandLine playExec, 'dist'
}
2016-03-15 12:02:54 -07:00
task "check" (overwrite: true) {
// skip gradle check of this repository
}
2015-11-19 14:39:21 -08:00
/*
// optional: if using 'eclipse' plugin
eclipse {
classpath {
plusConfigurations += configurations.playManaged
plusConfigurations += configurations.provided
}
}
*/