Split test app project out of root project.

This commit is contained in:
Adam Murdoch
2012-09-16 07:02:46 +10:00
parent 30cc864813
commit 40afbc5cc5
3 changed files with 49 additions and 36 deletions

View File

@@ -1,28 +1,41 @@
apply plugin: 'java'
apply plugin: 'groovy' apply plugin: 'groovy'
apply plugin: 'cpp' apply plugin: 'cpp'
apply plugin: 'idea'
apply plugin: 'application'
apply plugin: 'maven'
repositories { allprojects {
mavenCentral() apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
repositories {
mavenCentral()
}
dependencies {
testCompile 'org.spockframework:spock-core:0.6-groovy-1.8'
}
group = 'net.rubygrapefruit'
version = '0.1'
sourceCompatibility = 1.5
targetCompatibility = 1.5
configurations.compile.extendsFrom = []
uploadArchives {
repositories {
mavenDeployer {
repository(url: uri("$rootProject.buildDir/repo"))
}
}
}
} }
dependencies { dependencies {
groovy 'org.codehaus.groovy:groovy:1.8.7' groovy 'org.codehaus.groovy:groovy:1.8.7'
testCompile 'org.spockframework:spock-core:0.6-groovy-1.8'
} }
group = 'net.rubygrapefruit'
version = '0.1'
mainClassName = 'net.rubygrapefruit.platform.Main'
def nativeHeadersDir = file("$buildDir/nativeHeaders") def nativeHeadersDir = file("$buildDir/nativeHeaders")
sourceCompatibility = 1.5
targetCompatibility = 1.5
configurations.compile.extendsFrom = []
cpp { cpp {
sourceSets { sourceSets {
@@ -101,28 +114,18 @@ task nativeHeaders {
} }
} }
def deployer = null def deployer = uploadArchives.repositories.mavenDeployer
uploadArchives {
repositories {
deployer = mavenDeployer {
repository(url: uri("$buildDir/repo"))
}
}
}
libraries.all { lib -> libraries.all { lib ->
def nativeJar = task("nativeJar${lib.name.capitalize()}", type: Jar) { def nativeJar = task("nativeJar${lib.name.capitalize()}", type: Jar) {
from lib.spec.task from lib.spec.task
baseName = lib.spec.baseName baseName = lib.spec.baseName
} }
startScripts.classpath += nativeJar.outputs.files
applicationDistribution.from(nativeJar) {
into 'lib'
}
lib.spec.task.dependsOn nativeHeaders lib.spec.task.dependsOn nativeHeaders
test.dependsOn lib.spec.task test.dependsOn lib.spec.task
artifacts { artifacts {
archives nativeJar archives nativeJar
runtime nativeJar
} }
def jniPom = deployer.addFilter(lib.name) { artifact, file -> def jniPom = deployer.addFilter(lib.name) { artifact, file ->
return file == nativeJar.archivePath return file == nativeJar.archivePath
@@ -137,16 +140,8 @@ javadoc {
exclude '**/internal/**' exclude '**/internal/**'
} }
applicationDistribution.from(javadoc) {
into 'javadoc'
}
artifacts {
archives distZip
}
def mainPom = deployer.addFilter('main') { artifact, file -> def mainPom = deployer.addFilter('main') { artifact, file ->
return file == distZip.archivePath || file == jar.archivePath return file == jar.archivePath
} }
mainPom.groupId = project.group mainPom.groupId = project.group
mainPom.artifactId = jar.baseName mainPom.artifactId = jar.baseName

View File

@@ -1 +1,5 @@
rootProject.name = 'native-platform' rootProject.name = 'native-platform'
include 'testApp'
project(':testApp').projectDir = new File(rootDir, 'test-app')

14
test-app/build.gradle Normal file
View File

@@ -0,0 +1,14 @@
apply plugin: 'application'
mainClassName = 'net.rubygrapefruit.platform.Main'
applicationName = 'native-platform-test'
archivesBaseName = 'native-platform-test'
dependencies {
compile project(':')
}
configurations.archives.artifacts.clear()
artifacts {
archives distZip
}