From ebc64caee852b37b86c27928f1c638faeb9f9d44 Mon Sep 17 00:00:00 2001 From: Purple Fox Date: Thu, 2 Aug 2012 09:55:40 +0100 Subject: [PATCH] fix up --- build.gradle | 88 ++++++++++++++---------- gradle.properties | 20 +----- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 0 4 files changed, 54 insertions(+), 56 deletions(-) delete mode 100644 settings.gradle diff --git a/build.gradle b/build.gradle index 7ecec35..7817ddb 100644 --- a/build.gradle +++ b/build.gradle @@ -14,27 +14,18 @@ * limitations under the License. */ -buildscript { - repositories { - maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } - mavenCentral() - } - dependencies { - classpath "org.vert-x:build-tools:$vertxBuildToolsVersion" - classpath "org.vert-x:gradle-plugin:$vertxGradlePluginVersion" - } -} - -apply from: 'gradle/setup.gradle' apply plugin: 'java' -apply plugin: 'vertx' // configures the test classpath correctly and adds busmod packaging -apply plugin: 'vertx-rhino' defaultTasks = ['assemble'] sourceCompatibility = '1.7' targetCompatibility = '1.7' -jar.enabled = false // we don't need this + +jar.enabled = false // We don't produce a jar + +configurations { + provided +} repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } @@ -42,33 +33,63 @@ repositories { } dependencies { - vertxProvided("org.vert-x:vertx-core:$vertxVersion") - vertxProvided("org.vert-x:vertx-platform:$vertxVersion") + provided "org.vert-x:vertx-core:$vertxVersion" + provided "org.vert-x:vertx-platform:$vertxVersion" - testCompile("org.vert-x:vertx-core:$vertxVersion") - testCompile("org.vert-x:vertx-platform:$vertxVersion") - testCompile("org.vert-x:vertx-lang-java:$vertxVersion") - testCompile("org.vert-x:vertx-lang-rhino:$vertxVersion") - testCompile("org.mozilla:rhino:$rhinoVersion") + testCompile( "org.vert-x:vertx-testframework:$vertxVersion" ) { + transitive = false + } + testCompile "junit:junit:$junitVersion" +} - testCompile("org.vert-x:vertx-testframework:$vertxVersion") { - transitive = false // don't need all of the other language deps +sourceSets { + main { + compileClasspath = compileClasspath + configurations.provided } +} + +task copyMod( type:Copy, dependsOn: 'classes' ) { + into "build/mod/$modulename-v$version" + from 'build/classes/main' + from 'src/main/conf' + into( 'lib' ) { + from configurations.compile + } +} + +// Package into build/libs/mod.zip +task dist( type: Zip, dependsOn: 'copyMod' ) { + group = 'vert.x' + description = "Assembles a vert.x module in 'mod.zip' format" + destinationDir = project.file('build/libs') + archiveName = 'mod.zip' + from project.file("build/mod") +} - testCompile "junit:junit:$junitVersion" + +task prepareVertxTest(type: Sync, dependsOn: 'copyMod' ) { + from 'build/mod' + into 'build/tmp/mod-test' } test { + // Can't have the app on the vert.x classpath + classpath = files( classpath.findAll { + !( it.toString() ==~ /.+build\/(classes|resources)\/main$/ ) + } ) + + // Some vert.x properties systemProperty 'vertx.test.timeout', 15 systemProperty 'vertx.mods', "$projectDir/build/tmp/mod-test" + systemProperty 'vertx.version', "$project.version" + + // Show output testLogging.showStandardStreams = true -} -task prepareVertxTest(type: Sync, dependsOn: ['prepareVertxModule']) { - from 'build/mod' - into 'build/tmp/mod-test' + // No idea why we need to depend on testClasses... + dependsOn << [ 'testClasses', 'copyMod', 'prepareVertxTest' ] } -test.dependsOn prepareVertxTest + task collectDeps(type: Copy) { group = 'vert.x' @@ -80,9 +101,4 @@ task collectDeps(type: Copy) { into("test") { from configurations.testCompile } -} - -task dist(dependsOn: ['build', 'packageVertxModule']) { - group = 'vert.x' - description = 'prepare a distributable busmod "mod.zip" package' -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index a9c2253..500bef1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,25 +1,7 @@ -# -# Copyright 2011 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# modulename=vertx.web-server version=1.0 -gradleVersion=1.0 - +gradleVersion=1.1 vertxVersion=1.2.0-SNAPSHOT -vertxBuildToolsVersion=0.1-SNAPSHOT -vertxGradlePluginVersion=0.1-SNAPSHOT junitVersion=4.10 rhinoVersion=1.7R4 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d0b5bea..3070a19 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-bin.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-1.1-bin.zip diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e69de29..0000000