Permalink
Browse files

switch to gradle layout

  • Loading branch information...
normen committed Mar 21, 2014
1 parent 30c2ee5 commit a16857c8f4e7aadf3ca5fcb79bff5c8f16eb5481
Showing 1,896 changed files with 949 additions and 7,612 deletions.
View
@@ -0,0 +1,124 @@
import org.gradle.api.artifacts.*
apply plugin: 'base' // To add "clean" task to the root project.
//apply plugin: 'java-library-distribution'
// This is applied to all sub projects
subprojects {
// Don't add to native builds
// if(!project.name.endsWith('native')){
apply from: rootProject.file('common.gradle')
// }
}
task run(dependsOn: ':jme3-examples:build', type: JavaExec) {
description = 'Run the jME3 examples'
main = 'jme3test.TestChooser'
classpath += files(subprojects.collect{project ->
project.sourceSets*.runtimeClasspath})
// classpath += files(subprojects.collect {project ->
// project.sourceSets*.output})
// classpath = sourceSets.main.runtimeClasspath
// args 'mrhaki'
// systemProperty 'simple.message', 'Hello '
}
defaultTasks 'run'
task libDist(dependsOn: subprojects.build) << {
// description 'Builds and copies the engine binaries, sources and javadoc to build/libDist'
File libFolder = mkdir("$buildDir/libDist/lib")
File sourceFolder = mkdir("$buildDir/libDist/sources")
File javadocFolder = mkdir("$buildDir/libDist/javadoc")
subprojects.each {project ->
if(project.ext.mainClass == ''){
project.tasks.withType(Jar).each {archiveTask ->
if(archiveTask.classifier == "sources"){
copy {
from archiveTask.archivePath
into sourceFolder
rename {project.name + '-' + archiveTask.classifier +'.'+ archiveTask.extension}
}
} else if(archiveTask.classifier == "javadoc"){
copy {
from archiveTask.archivePath
into javadocFolder
rename {project.name + '-' + archiveTask.classifier +'.'+ archiveTask.extension}
}
} else{
copy {
from archiveTask.archivePath
into libFolder
rename {project.name + '.' + archiveTask.extension}
}
}
}
}
}
}
task copyLibs(type: Copy){
// description 'Copies the engine dependencies to build/libDist'
from {
subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve()
}
into "$buildDir/libDist/lib-ext" //buildDir.path + '/' + libsDirName + '/lib'
}
task dist(dependsOn: [':jme3-examples:dist', 'mergedJavadoc']){
description 'Creates a jME3 examples distribution with all jme3 binaries, sources, javadoc and external libraries under ./dist'
}
task mergedJavadoc(type: Javadoc, description: 'Creates Javadoc from all the projects.') {
title = 'jMonkeyEngine3'
destinationDir = mkdir("dist/javadoc")
// Note: The closures below are executed lazily.
source subprojects.collect {project ->
project.sourceSets*.allJava
}
// classpath = files(subprojects.collect {project ->
// project.sourceSets*.compileClasspath})
// source {
// subprojects*.sourceSets*.main*.allSource
// }
classpath.from {
subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve()
}
}
task mergedSource(type: Copy){
}
task wrapper(type: Wrapper, description: 'Creates and deploys the Gradle wrapper to the current directory.') {
gradleVersion = '1.10'
}
//class IncrementalReverseTask extends DefaultTask {
// @InputDirectory
// def File inputDir
//
// @OutputDirectory
// def File outputDir
//
// @Input
// def inputProperty
//
// @TaskAction
// void execute(IncrementalTaskInputs inputs) {
// println inputs.incremental ? "CHANGED inputs considered out of date" : "ALL inputs considered out of date"
// inputs.outOfDate { change ->
// println "out of date: ${change.file.name}"
// def targetFile = new File(outputDir, change.file.name)
// targetFile.text = change.file.text.reverse()
// }
//
// inputs.removed { change ->
// println "removed: ${change.file.name}"
// def targetFile = new File(outputDir, change.file.name)
// targetFile.delete()
// }
// }
//}
View
147 build.xml

This file was deleted.

Oops, something went wrong.
View
@@ -0,0 +1,84 @@
//
// This file is to be applied to every subproject.
//
apply plugin: 'java'
apply plugin: 'maven'
//String jmeVersion = '3.0.10'
//String jmeVersion = rootProject.version;
String mavenGroupId = 'com.jme3'
String mavenVersion = jmeVersion + jmeVersionSuffix //'-SNAPSHOT'
sourceCompatibility = '1.5'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral();
maven{
url "http://nifty-gui.sourceforge.net/nifty-maven-repo"
}
// You may define additional repositories, or even remove "mavenCentral()".
// Read more about repositories here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
}
dependencies {
// Adding dependencies here will add the dependencies to each subproject.
testCompile group: 'junit', name: 'junit', version: '4.10'
}
String mavenArtifactId = name
group = mavenGroupId
version = mavenVersion
//jar.doFirst{
// manifest {
// attributes('Manifest-Version' : '1.0',
// 'Created-By' : vendor,
// 'Specification-Title' : appName,
// 'Specification-Version' : version,
// 'Specification-Vendor' : vendor,
// 'Implementation-Title' : appName,
// 'Implementation-Version' : version,
// 'Implementation-Vendor' : vendor,
// 'Main-Class' : getProperty('mainClass'),
// 'Class-Path' : configurations.compile.collect { 'lib/' + it.getName() }.join(' ')
// )
// }
//}
task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
classifier = 'sources'
from sourceSets*.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from the javadoc files.') {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
archives sourcesJar
// archives javadocJar
}
configure(install.repositories.mavenInstaller) {
pom.project {
groupId = mavenGroupId
artifactId = mavenArtifactId
version = mavenVersion
}
}
task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
// sourceSets*.allSource*.srcDirs*.each { File srcDir ->
// if (!srcDir.isDirectory()) {
// println "Creating source folder: ${srcDir}"
// srcDir.mkdirs()
// }
// }
}
View

This file was deleted.

Oops, something went wrong.
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit a16857c

Please sign in to comment.