Skip to content

Commit

Permalink
Merge pull request #46 from mlueders/gradle_2
Browse files Browse the repository at this point in the history
Gradle 2
  • Loading branch information
mlueders committed Aug 10, 2014
2 parents d5e2d28 + d04d825 commit 061beef
Show file tree
Hide file tree
Showing 50 changed files with 167 additions and 159 deletions.
89 changes: 32 additions & 57 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import com.bancvue.gradle.maven.DefaultPublishFilter
import org.apache.ivy.core.module.descriptor.Artifact
import org.gradle.api.publication.maven.internal.PomFilter

buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public"}
jcenter()
}
dependencies {
classpath 'com.github.townsfolk:gradle-release:1.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5'
}
}


apply plugin: 'release'
apply plugin: "bancvue-oss"
apply plugin: "integration-test"
apply plugin: "com.bancvue.core-oss"
apply plugin: "com.bancvue.integration-test"
apply plugin: "com.bancvue.maven-publish-ext"
apply plugin: 'com.jfrog.bintray'

repositories {
mavenCentral()
jcenter()
}

dependencies {
Expand All @@ -27,7 +26,7 @@ dependencies {
exclude group: 'com.google.guava'
}

mainTestCompile('org.spockframework:spock-core:0.7-groovy-1.8') {
mainTestCompile('org.spockframework:spock-core:0.7-groovy-2.0') {
exclude group: 'org.codehaus.groovy'
}
mainTestCompile 'cglib:cglib-nodep:2.2.2'
Expand All @@ -47,55 +46,31 @@ license {
[licenseMainTest, licenseFormatMainTest]*.exclude "org/gradle/testkit/**"



/**********************************************************************************************************************/
// Everything below is POC

artifacts {
archives jarMainTest
archives sourcesJarMainTest
}

uploadArchives {
repositories.mavenDeployer {

pom.project {
packaging "jar"
url "https://github.com/BancVue/GradlePluginsCore"
developers {
developer {
id "bancvue_oss"
name "BancVue Open Source Development"
email "[email protected]"
}
}
scm {
url "https://github.com/BancVue/GradlePluginsCore.git"
connection "scm:git:[email protected]:BancVue/GradlePluginsCore.git"
developerConnection "scm:git:[email protected]:BancVue/GradlePluginsCore.git"
}
}
}
}

uploadArchives {
repositories.mavenDeployer {
addFilter("test") { Artifact artifact, file ->
(artifact.name =~ /.*-test$/).matches()
}
addFilter("default", new DefaultPublishFilter(it))

getActivePomFilters().each { PomFilter pomFilter ->
pomFilter.setPomTemplate(pom.effectivePom)
}
}
publishing_ext {
publication("mainTest")
}

install {
repositories.mavenInstaller {
addFilter("test") { Artifact artifact, file ->
(artifact.name =~ /.*-test$/).matches()
bintray {
user = 'bancvue'
key = '--changeme--'

publications = ['gradleCore', 'gradleCoreTest']
dryRun = false
publish = false
pkg {
repo = 'maven'
userOrg = 'bancvue'
name = project.ext['artifactId']
desc = project.description
websiteUrl = 'https://github.com/BancVue/gradle-core'
issueTrackerUrl = 'https://github.com/BancVue/gradle-core/issues'
vcsUrl = 'https://github.com/BancVue/gradle-core.git'
licenses = ['Apache-2.0']
labels = ['gradle']
publicDownloadNumbers = true
version {
vcsTag = project.version
attributes = ['gradle-plugin': 'com.bancvue.core-oss:com.bancvue:gradle-core']
}
addFilter("default", new DefaultPublishFilter(it))
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
group=com.bancvue
artifactId=gradle-core
version=0.20-SNAPSHOT
description=Gradle plugins for general project development
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.11-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-2.0-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class IdeExtPluginIntegrationSpecification extends AbstractPluginIntegrationSpec
given:
buildFile << """
apply plugin: 'groovy'
apply plugin: 'ide-ext'
apply plugin: 'integration-test'
apply plugin: 'com.bancvue.ide-ext'
apply plugin: 'com.bancvue.integration-test'
repositories {
mavenCentral()
Expand Down Expand Up @@ -96,8 +96,8 @@ dependencies {
given:
buildFile << """
apply plugin: 'groovy'
apply plugin: 'ide-ext'
apply plugin: 'component-test'
apply plugin: 'com.bancvue.ide-ext'
apply plugin: 'com.bancvue.component-test'
repositories {
mavenCentral()
Expand Down Expand Up @@ -151,8 +151,8 @@ dependencies {
given:
buildFile << """
apply plugin: 'groovy'
apply plugin: 'ide-ext'
apply plugin: 'integration-test'
apply plugin: 'com.bancvue.ide-ext'
apply plugin: 'com.bancvue.integration-test'
"""
mkdir("src/main/resources")
mkdir("src/test/resources")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ext {
repositoryReleaseUrl='${mavenRepo.toURI()}'
}
apply plugin: 'custom-gradle'
apply plugin: 'com.bancvue.custom-gradle'
// fake out the download and replace it with an empty zip
task createDownloadArchive(type: Zip) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ ext {
licenseName='BancVue'
}
apply plugin: 'test-ext'
apply plugin: 'license-ext'
apply plugin: 'com.bancvue.test-ext'
apply plugin: 'com.bancvue.license-ext'
"""

when:
Expand All @@ -58,7 +58,7 @@ apply plugin: 'license-ext'
File srcFile = emptyClassFile('src/main/java/Class.java')
buildFile << """
apply plugin: 'java'
apply plugin: 'license-ext'
apply plugin: 'com.bancvue.license-ext'
license {
ext.year='1975'
Expand All @@ -85,7 +85,7 @@ ext {
}
apply plugin: 'java'
apply plugin: 'license-ext'
apply plugin: 'com.bancvue.license-ext'
"""

when:
Expand All @@ -101,7 +101,7 @@ apply plugin: 'license-ext'
File srcFile = emptyClassFile('src/main/java/Class.java')
buildFile << """
apply plugin: 'java'
apply plugin: 'license-ext'
apply plugin: 'com.bancvue.license-ext'
license {
ignoreFailures true
Expand All @@ -120,8 +120,8 @@ license {
File srcFile = emptyClassFile('src/mainTest/java/Class.java')
buildFile << """
apply plugin: 'java'
apply plugin: 'license-ext'
apply plugin: 'test-ext'
apply plugin: 'com.bancvue.license-ext'
apply plugin: 'com.bancvue.test-ext'
license {
ignoreFailures true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ version = '1.0'
given:
emptyClassFile("src/main/java/Class.java")
buildFile << """
apply plugin: 'project-defaults'
apply plugin: 'maven-ext'
apply plugin: 'com.bancvue.project-defaults'
apply plugin: 'com.bancvue.maven-ext'
"""

when:
Expand All @@ -55,7 +55,7 @@ apply plugin: 'maven-ext'
def "should supportdeployer customizations in build file"() {
given:
buildFile << """
apply plugin: 'maven-ext'
apply plugin: 'com.bancvue.maven-ext'
project.uploadArchives {
repositories.mavenDeployer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class MavenPublishExtPluginIntegrationSpecification extends AbstractPluginIntegr
ext.repositoryReleaseUrl='${mavenRepo.toURI()}'
ext.artifactId='artifact'
apply plugin: 'maven-publish-ext'
apply plugin: 'project-defaults' // set jar baseName to artifactId
apply plugin: 'com.bancvue.maven-publish-ext'
apply plugin: 'com.bancvue.project-defaults' // set jar baseName to artifactId
group = 'group'
version = '1.0'
Expand Down Expand Up @@ -84,7 +84,7 @@ version = '1.0'
given:
emptyClassFile("src/other/java/MainClass.java")
buildFile << """
apply plugin: 'maven-publish-ext'
apply plugin: 'com.bancvue.maven-publish-ext'
publishing_ext {
publication("main") {
Expand Down Expand Up @@ -258,7 +258,7 @@ dependencies {
emptyClassFile("src/mainTest/java/MainTestClass.java")
setupLocalMavenRepoAndApplyPlugin()
buildFile << """
apply plugin: 'test-ext'
apply plugin: 'com.bancvue.test-ext'
repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MavenPublishExtPluginMultiModuleIntegrationSpecification extends AbstractP

private TestFile initMultiModuleBuildFile() {
buildFile << """
apply plugin: 'maven-publish-ext'
apply plugin: 'com.bancvue.maven-publish-ext'
ext.artifactId='artifact'
Expand All @@ -42,7 +42,7 @@ repositories {
}
allprojects {
apply plugin: 'project-defaults' // set jar baseName to artifactId
apply plugin: 'com.bancvue.project-defaults' // set jar baseName to artifactId
ext.repositoryReleaseUrl='${mavenRepo.toURI()}'
group = 'group'
Expand All @@ -69,7 +69,7 @@ dependencies {
}
"""
file("publishedDependency/build.gradle") << """
apply plugin: 'maven-publish-ext'
apply plugin: 'com.bancvue.maven-publish-ext'
"""

when:
Expand All @@ -89,15 +89,15 @@ apply plugin: 'maven-publish-ext'
file("settings.gradle") << "include 'subModule', 'subModulePublishedDependency', 'subModuleLocalDependency'"
initMultiModuleBuildFile()
file("subModule/build.gradle") << """
apply plugin: 'maven-publish-ext'
apply plugin: 'com.bancvue.maven-publish-ext'
dependencies {
compile project(":subModulePublishedDependency")
compile project(":subModuleLocalDependency")
}
"""
file("subModulePublishedDependency/build.gradle") << """
apply plugin: 'maven-publish-ext'
apply plugin: 'com.bancvue.maven-publish-ext'
"""

when:
Expand All @@ -122,8 +122,8 @@ dependencies {
}
"""
file("publishedDependency/build.gradle") << """
apply plugin: 'test-ext'
apply plugin: 'maven-publish-ext'
apply plugin: 'com.bancvue.test-ext'
apply plugin: 'com.bancvue.maven-publish-ext'
publishing_ext {
publication("mainTest")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CpdPluginIntegrationSpecification extends AbstractCpdPluginIntegrationSpec
def setup() {
buildFile << """
apply plugin: 'java'
apply plugin: 'cpd'
apply plugin: 'com.bancvue.cpd'
repositories {
mavenCentral()
Expand All @@ -50,14 +50,14 @@ cpd {
file("build/reports/cpd/all.html").exists()
}

def "should enable sourceSet-specific tasks if createUnifiedReport set to false"() {
def "should enable sourceSet-specific tasks if createAllReport set to false"() {
emptyClassFile("src/main/java/bv/SomeClass.java")
classFileWithDuplicateTokens("src/mainTest/java/bv/MainTestClass.java", minTokenCount)
buildFile << """
apply plugin: 'test-ext'
apply plugin: 'com.bancvue.test-ext'
cpd {
createUnifiedReport false
createAllReport false
}
"""

Expand All @@ -70,10 +70,10 @@ cpd {
file("build/reports/cpd/mainTest.html").exists()
}

def "should not create unified report task if createUnifiedReport set to false"() {
def "should not create all report task if createAllReport set to false"() {
buildFile << """
cpd {
createUnifiedReport false
createAllReport false
}
"""

Expand All @@ -90,7 +90,7 @@ cpd {
int halfMinTokenCount = (minTokenCount / 2) as int
classFileWithDuplicateTokens("src/main/java/bv/SomeClass.java", halfMinTokenCount)
buildFile << """
apply plugin: 'test-ext'
apply plugin: 'com.bancvue.test-ext'
"""

when:
Expand Down
Loading

0 comments on commit 061beef

Please sign in to comment.