Skip to content

Commit

Permalink
Merge dbf59d3 into d2fb7a9
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdubiel committed Mar 21, 2015
2 parents d2fb7a9 + dbf59d3 commit 08c8762
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: java

install: ./gradlew assemble
script: ./gradlew check
after_success: ./gradlew jacocoTestReport coveralls

jdk:
- openjdk7
- openjdk7
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ axion-release-plugin
*gradle release and version management plugin*

[![Build Status](https://travis-ci.org/allegro/axion-release-plugin.svg?branch=master)](https://travis-ci.org/allegro/axion-release-plugin)
[![Coverage Status](https://coveralls.io/repos/allegro/axion-release-plugin/badge.svg?branch=development)](https://coveralls.io/r/allegro/axion-release-plugin)
[![readthedocs](https://readthedocs.org/projects/axion-release-plugin/badge/?version=latest) ](http://axion-release-plugin.readthedocs.org/en/latest/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/pl.allegro.tech.build/axion-release-plugin/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/pl.allegro.tech.build/axion-release-plugin)
[![JCenter](https://api.bintray.com/packages/allegro/maven/axion-release-plugin/images/download.svg) ](https://bintray.com/allegro/maven/axion-release-plugin/_latestVersion)
Expand Down
15 changes: 11 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'jacoco'
id 'nu.studer.plugindev' version '1.0.3'
id 'pl.allegro.tech.build.axion-release' version '1.2.0'
id 'com.github.kt3k.coveralls' version '2.3.1'
}

scmVersion {
Expand All @@ -30,8 +31,8 @@ dependencies {
compile gradleApi()
compile localGroovy()

compile group: 'org.ajoberstar', name: 'grgit', version: '0.4.0'
compile group: 'com.github.zafarkhaja', name: 'java-semver', version: '0.8.0'
compile group: 'org.ajoberstar', name: 'grgit', version: '1.1.0'
compile group: 'com.github.zafarkhaja', name: 'java-semver', version: '0.9.0'

testCompile(group: 'org.spockframework', name: 'spock-core', version: '0.7-groovy-2.0') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
Expand All @@ -45,8 +46,15 @@ test {
}
}

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}

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

plugindev {
Expand Down Expand Up @@ -76,4 +84,3 @@ bintray {
}
}
}

3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

* **1.2.2** (21.03.2015)
* use newer GrGit (and JGit) version with some bugfixes
* start using Coveralls
* **1.2.1** (08.03.2015)
* create separate tasks for tag creation and pushing
* possibility to use different configuration across multiple modules
Expand Down
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 @@
#Mon Dec 01 17:51:29 CET 2014
#Sat Mar 21 09:19:14 CET 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package pl.allegro.tech.build.axion.release.infrastructure.di

import org.gradle.api.Project
import pl.allegro.tech.build.axion.release.domain.RepositoryConfig
import pl.allegro.tech.build.axion.release.domain.scm.ScmIdentity
import pl.allegro.tech.build.axion.release.domain.scm.ScmIdentityResolver
import pl.allegro.tech.build.axion.release.domain.scm.ScmInitializationOptions
import pl.allegro.tech.build.axion.release.domain.scm.ScmRepository
import pl.allegro.tech.build.axion.release.domain.scm.ScmRepositoryUnavailableException
Expand All @@ -20,7 +22,8 @@ class ScmRepositoryFactory {
ScmRepository repository
try {
ScmInitializationOptions initializationOptions = ScmInitializationOptions.fromProject(project, config.remote)
repository = new GitRepository(config.directory, initializationOptions)
ScmIdentity identity = ScmIdentityResolver.resolve(config)
repository = new GitRepository(config.directory, identity, initializationOptions)
}
catch(ScmRepositoryUnavailableException exception) {
project.logger.warn("Failed top open repository, trying to work without it", exception)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class GitRepository implements ScmRepository {

private final Grgit repository

GitRepository(File repositoryDir, ScmInitializationOptions options) {
GitRepository(File repositoryDir, ScmIdentity identity, ScmInitializationOptions options) {
try {
this.repositoryDir = repositoryDir
repository = Grgit.open(repositoryDir)
repository = Grgit.open(dir: repositoryDir)
}
catch(RepositoryNotFoundException exception) {
throw new ScmRepositoryUnavailableException(exception)
Expand All @@ -39,7 +39,7 @@ class GitRepository implements ScmRepository {
this.attachRemote(options.remote, options.remoteUrl)
}
if (options.fetchTags) {
this.fetchTags()
this.fetchTags(identity, options.remote)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class GitRepositoryTest extends Specification {

ScmInitializationOptions initializationOptions

ScmIdentity identity = ScmIdentity.defaultIdentity()

Grgit rawRepository

Grgit remoteRawRepository
Expand All @@ -36,7 +38,7 @@ class GitRepositoryTest extends Specification {
rawRepository = Grgit.clone(dir: projectDir, uri: "file://$remoteProjectDir.canonicalPath")

initializationOptions = ScmInitializationOptions.fromProject(project, 'origin')
repository = new GitRepository(projectDir, initializationOptions)
repository = new GitRepository(projectDir, identity, initializationOptions)
}


Expand All @@ -45,7 +47,7 @@ class GitRepositoryTest extends Specification {
Project gitlessProject = ProjectBuilder.builder().build()

when:
new GitRepository(gitlessProject.file('./'), initializationOptions)
new GitRepository(gitlessProject.file('./'), identity, initializationOptions)

then:
thrown(ScmRepositoryUnavailableException)
Expand Down Expand Up @@ -94,7 +96,7 @@ class GitRepositoryTest extends Specification {
File projectDir = commitlessProject.file('./')

Grgit.init(dir: projectDir)
GitRepository commitlessRepository = new GitRepository(projectDir, initializationOptions)
GitRepository commitlessRepository = new GitRepository(projectDir, identity, initializationOptions)

when:
ScmPosition position = commitlessRepository.currentPosition(~/^release.*/)
Expand Down

0 comments on commit 08c8762

Please sign in to comment.