Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

[#17] Switch releasing to micro-common-release #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
before_install:
- "export GRADLE_OPTS='-Dorg.gradle.daemon=true'"

install:
- ./gradlew assemble --stacktrace

script:
- set -e
- ./gradlew check --stacktrace --continue
- source build/release/gradle/setGitVariables.sh
- ./gradlew release -Prelease.disableRemoteCheck -Prelease.localOnly --info --stacktrace
- ./gradlew check finalizeRelease publishUploadedArtifacts -Pcoverage -PbintrayUser=${BINTRAY_USER} -PbintrayKey=${BINTRAY_API_KEY} --info --stacktrace

after_success:
- ./gradlew jacocoTestReport coveralls -Pcoverage --continue

language: groovy

jdk:
- oraclejdk8

after_success:
- ./gradlew test jacocoTestReport coveralls -Pcoverage

matrix:
include:
# Release not skipped only in Java 7 build
- jdk: oraclejdk7
env: SKIP_RELEASE=false
env:
global:
- TERM=dumb
- SKIP_RELEASE=true
- secure: WUCdpVfFjndzmq7MWazJgaDn4FwiomH4Fvwe0qx6lwUfYABFmrMzjxm/0UpXMWoWQWT+mbIVB0rJqGB6zX5yKdNALn7P1VDL+qD7JM8MgQJiqbZKqjXmtLIUeuL4uZ+kQZTWyW7HUnTfcQ+o4XOgq6j+tiDVte0NB2fuRVLketE=
- secure: LrNiKsKJf7mYFdzBfMxV1ImEr7NwTMrVY6KiEkdXAdmBCAIdpchbTYbl32DKVCpP3bgQF+Ff8GMPdvu3OwXJ6tWE65Gx5HpHW5Axt0QcNMoE8wE7n1KUWnWMdhtLKgGjG2L6g8k0TgHcIbYTvpSpsV0xK85puQtbsETlaOTu90k=
- secure: GA7LePBKl/sfmPnJ3cqqmzvLj20Zl/Ch5SFVduTDy0Vxx8Z08u80zlJTIH7dQ2mOpvvmgGZ21BcNt3Favx/fdCwzGlx3vJD7vv9tN/frzVjOXdy/LZimFMEcfGOz6iKURiDrvtpI5vVrhR0AOfV8W1YBOTkPiUryUgoDNOrA2s0=
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ New versions available:
#### Step 1: Add dependency to JCenter and to the plugin
```
buildscript {
repositories {
repositories {
jcenter()
}
dependencies {
Expand Down
102 changes: 42 additions & 60 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,96 +1,81 @@
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5'

if (project.hasProperty('coverage')) {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:1.0.2'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.3.1'
}
classpath "com.ofg:micro-common-release:0.1.17"
}
dependencies {
ant.unjar src: configurations.classpath.find { it.name.startsWith("micro-common-release") }, dest: 'build/release'
}
}

apply plugin: 'com.jfrog.bintray'
apply from: "${rootProject.buildDir}/release/gradle/version.gradle"
scmVersion {
tag {
prefix = ''
}
}

project.group = 'com.ofg'
project.version = scmVersion.version
project.description = 'Gradle plugin that tells you what libs have new versions in Maven Central / JCenter'

apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply from: "${rootProject.buildDir}/release/gradle/publish.gradle"
apply from: "${rootProject.buildDir}/release/gradle/release.gradle"

bintray {
pkg {
repo = 'uptodate-gradle-plugin'
labels = ['gradle']
version {
attributes = ['gradle-plugin': 'com.ofg.uptodate:com.ofg:uptodate-gradle-plugin']
}
}
}

group = 'com.ofg'
description = 'Core of UpToDate plugin'
version = '1.5.1-SNAPSHOT'
sourceCompatibility = 1.7

repositories {
mavenLocal()
mavenCentral()
jcenter()
}

dependencies {
compile gradleApi()
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.2'
compile("org.codehaus.groovy.modules.http-builder:http-builder:0.7.1") {
exclude group: 'xerces', module: 'xercesImpl' //conflicts with xercesImpl from Gradle (in functional tests)
}

testCompile 'junit:junit:4.11'
testCompile 'org.spockframework:spock-core:0.7-groovy-1.8'
testCompile 'com.github.tomakehurst:wiremock:1.47'
testCompile('org.spockframework:spock-core:1.0-groovy-2.3') {
exclude group: 'org.codehaus.groovy' //to not override version from Gradle
}
testCompile 'com.github.tomakehurst:wiremock:1.50' //1.51+ requires httpclient 4.3+ which conflicts with version distributed with Gradle
testRuntime 'cglib:cglib-nodep:2.2.2'
testRuntime 'org.objenesis:objenesis:1.2'
}

task wrapper(type: Wrapper) {
gradleVersion = '1.12'
wrapper {
gradleVersion '2.3'
}

bintrayUpload.dependsOn 'build'

publishing {
publications {
plugin(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
test {
testLogging {
exceptionFormat = 'full'
}
}

bintray {
user = System.properties['bintrayUser']
key = System.properties['bintrayKey']
publications = ['plugin']
pkg {
repo = 'uptodate-gradle-plugin'
userOrg = '4finance'
name = 'uptodate-gradle-plugin'
desc = 'Gradle plugin that tells you what libs have new versions in Maven Central / JCenter'
licenses = ['Apache-2.0']
labels = ['gradle']
version {
attributes = ['gradle-plugin': 'com.ofg.uptodate:com.ofg:uptodate-gradle-plugin']
}
}
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: groovydoc) {
classifier = 'javadoc'
from groovydoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

if (project.hasProperty('coverage')) {
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'

jacoco {
toolVersion = '0.7.1.201405082137'
toolVersion = '0.7.4.201502262128'
}

jacocoTestReport {
Expand All @@ -99,8 +84,5 @@ if (project.hasProperty('coverage')) {
html.enabled = true
}
}
test {
ignoreFailures = true
}
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jun 24 08:55:14 CEST 2014
#Wed Mar 18 16:49:58 CET 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'uptodate-gradle-plugin'
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.ofg.uptodate.finder

import groovy.transform.Immutable
import groovy.transform.PackageScope

@PackageScope
@Immutable
class RepositorySettings {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.ofg.uptodate.finder.NewVersionFinderFactory
import com.ofg.uptodate.finder.http.HTTPBuilderProvider
import com.ofg.uptodate.finder.FinderConfiguration
import com.ofg.uptodate.finder.RepositorySettings
import groovy.transform.PackageScope
import groovy.util.logging.Slf4j
import groovy.util.slurpersupport.NodeChild
import groovyx.net.http.HTTPBuilder
Expand All @@ -18,7 +17,6 @@ import java.util.concurrent.Future

import static com.ofg.uptodate.finder.http.HTTPBuilderProvider.FailureHandlers.logOnlyFailureHandler

@PackageScope
@Slf4j
class JCenterNewVersionFinderFactory implements NewVersionFinderFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import java.util.concurrent.Future
import static com.ofg.uptodate.UrlEspaceUtils.escape
import static com.ofg.uptodate.finder.http.HTTPBuilderProvider.FailureHandlers.logOnlyFailureHandler

@PackageScope
@Slf4j
class MavenNewVersionFinderFactory implements NewVersionFinderFactory {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.ofg.uptodate.finder

import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock
import com.ofg.uptodate.http.HttpMockServer
import groovy.transform.PackageScope

@PackageScope
class HttpProxyServerProvider {

public static final int MOCK_HTTP_PROXY_SERVER_PORT = 12406
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.ofg.uptodate.finder.HttpProxyServerProvider
import com.ofg.uptodate.finder.NewFinderSpec
import groovy.text.SimpleTemplateEngine
import org.codehaus.groovy.runtime.StackTraceUtils
import spock.lang.Unroll

import static com.ofg.uptodate.VersionPatterns.*
import static com.ofg.uptodate.Xmls.*
Expand Down Expand Up @@ -55,10 +56,11 @@ class JCenterNewVersionFinderSpec extends NewFinderSpec {
1 * loggerProxy.lifecycle(_, NO_NEW_VERSIONS_MESSAGE)
}

@Unroll
def "should not fail or display excluded versions for dependencies found in external repo"() {
given:
artifactMetadataRequestResponse('org.hibernate', 'hibernate-core', new SimpleTemplateEngine().createTemplate(RESPONSE_TEMPLATE).make([artifactVersion: artifactVersion]).toString())
project.extensions.uptodate.versionToExcludePatterns = [ALPHA, BETA, RC, CR, SNAPSHOT]
project.extensions.uptodate.setExcludedVersionPatterns(ALPHA, BETA, RC, CR, SNAPSHOT)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is something strange with those tests. versionToExcludePatterns was removed in 1.1.0, but they passed before I upgraded Groovy to 2.3.

and:
project.dependencies.add(COMPILE_CONFIGURATION, 'org.hibernate:hibernate-core:0.5.5')
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.ofg.uptodate.finder.HttpProxyServerProvider
import com.ofg.uptodate.finder.NewFinderSpec
import groovy.text.SimpleTemplateEngine
import org.codehaus.groovy.runtime.StackTraceUtils
import spock.lang.Unroll

import static com.ofg.uptodate.Jsons.*
import static com.ofg.uptodate.VersionPatterns.*
Expand Down Expand Up @@ -59,10 +60,11 @@ class MavenNewVersionFinderSpec extends NewFinderSpec {
1 * loggerProxy.lifecycle(_, NO_NEW_VERSIONS_MESSAGE)
}

@Unroll
def "should not fail or display excluded versions for dependencies found in external repo"() {
given:
artifactMetadataRequestResponse('org.hibernate', 'hibernate-core', new SimpleTemplateEngine().createTemplate(RESPONSE_TEMPLATE).make([artifactVersion: artifactVersion]).toString())
project.extensions.uptodate.versionToExcludePatterns = [ALPHA, BETA, RC, CR, SNAPSHOT]
project.extensions.uptodate.setExcludedVersionPatterns(ALPHA, BETA, RC, CR, SNAPSHOT)
and:
project.dependencies.add(COMPILE_CONFIGURATION, 'org.hibernate:hibernate-core:0.5.5')
when:
Expand Down