mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-11-03 20:27:50 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			115 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			115 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
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')
 | 
						|
}
 | 
						|
 | 
						|
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]
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
// delegate gradle java task to play command
 | 
						|
 | 
						|
task "build" (type: Exec, dependsOn: playClean, overwrite: true) {
 | 
						|
    commandLine playExec, 'stage'
 | 
						|
}
 | 
						|
 | 
						|
task "assemble" (type: Exec, dependsOn: playClean, overwrite: true) {
 | 
						|
  commandLine playExec, 'stage'
 | 
						|
}
 | 
						|
 | 
						|
task "dist" (type: Exec, overwrite: true) {
 | 
						|
    commandLine playExec, 'dist'
 | 
						|
}
 | 
						|
 | 
						|
task "check" (overwrite: true) {
 | 
						|
  // skip gradle check of this repository
 | 
						|
}
 | 
						|
/*
 | 
						|
// optional: if using 'eclipse' plugin
 | 
						|
eclipse {
 | 
						|
    classpath {
 | 
						|
        plusConfigurations += configurations.playManaged
 | 
						|
        plusConfigurations += configurations.provided
 | 
						|
    }
 | 
						|
}
 | 
						|
*/
 |