Skip to content
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
27 changes: 27 additions & 0 deletions multi-project-cross-project-dependency-single-version/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# multi-project-single-version example

This is a simple example on how a multi project could look like and how the gradle-release plugin is configured.
In this example we use one version for all the projects.

## Usage

Fork the repository and checkout locally.

Then you can test executing the release by

```
$ cd multi-project-single-version
$ ./gradlew release
```

On windows you would do

```
$ cd multi-project-single-version
$ gradlew.bat release
```

## Contributing

If you have an idea which feature of the gradle-release plugin we could show here,
you are welcome to submit a pull request.
33 changes: 33 additions & 0 deletions multi-project-cross-project-dependency-single-version/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
id 'idea'
id 'net.researchgate.release' version '2.3.5'
}

allprojects {
apply plugin: 'java'

repositories {
jcenter()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
}
}

release {
tagTemplate = '$name-$version'
}

task(startmessage) << {
println 'starting build'
}

task(printversion) << {
println project.version
}

beforeReleaseBuild.dependsOn startmessage
afterReleaseBuild.dependsOn printversion

wrapper.gradleVersion = '2.10'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version=1.0.1-SNAPSHOT
group='net.researchgate'
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sat Jan 16 20:06:51 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
160 changes: 160 additions & 0 deletions multi-project-cross-project-dependency-single-version/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions multi-project-cross-project-dependency-single-version/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rootProject.name = 'multi-project-cross-project-dependency-single-version'
include ('subproject1','subproject2')
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* This file is part of the gradle-release-examples.
*
* (c) ResearchGate GmbH
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

package net.researchgate.release.examples.multiprojectsingleversion;

public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* This file is part of the gradle-release-examples.
*
* (c) ResearchGate GmbH
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

package net.researchgate.release.examples.multiprojectsingleversion;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

public class MainTest {

private final ByteArrayOutputStream outContent = new ByteArrayOutputStream();

@Before
public void setUpStreams() {
System.setOut(new PrintStream(outContent));
}

@After
public void cleanUpStreams() {
System.setOut(null);
}

@Test
public void testMain() {
Main.main(new String[]{});
Assert.assertEquals("Hello world!", outContent.toString().trim());
}
}
Loading