Skip to content

Commit 3e10f44

Browse files
authored
Switch to GitHub workflows. (#123)
1 parent 78b0d71 commit 3e10f44

File tree

11 files changed

+174
-74
lines changed

11 files changed

+174
-74
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: JDK ${{ matrix.java_version }}
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
java_version: [1.8]
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Gradle Wrapper Validation
19+
uses: gradle/wrapper-validation-action@v1
20+
21+
- name: Install JDK ${{ matrix.java_version }}
22+
uses: actions/setup-java@v1
23+
with:
24+
java-version: ${{ matrix.java_version }}
25+
26+
- name: Build with Gradle
27+
run: ./gradlew build --stacktrace
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Install JDK 8
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 1.8
21+
22+
- name: Upload release
23+
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
24+
env:
25+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
26+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
28+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
29+
30+
- name: Publish release
31+
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
32+
env:
33+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
34+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Snapshot
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
publish:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Install JDK 8
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 1.8
21+
22+
- name: Retrieve version
23+
run: |
24+
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
25+
26+
- name: Publish snapshot
27+
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
28+
if: endsWith(env.VERSION_NAME, '-SNAPSHOT')
29+
env:
30+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
31+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

build.gradle

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlinVersion = '1.3.21'
2+
ext.kotlinVersion = '1.3.50'
33

44
repositories {
55
mavenCentral()
@@ -10,11 +10,10 @@ buildscript {
1010

1111
dependencies {
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
13-
classpath 'com.gradle.publish:plugin-publish-plugin:0.10.1'
1413
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
1514
classpath 'com.vanniktech:gradle-code-quality-tools-plugin:0.16.0'
16-
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.13.0'
17-
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.7.0'
15+
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.16.0'
16+
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.16.0'
1817
}
1918
}
2019

@@ -26,7 +25,6 @@ apply plugin: 'com.github.ben-manes.versions'
2625
apply plugin: 'com.vanniktech.code.quality.tools'
2726
apply plugin: 'com.vanniktech.android.junit.jacoco'
2827
apply plugin: "com.vanniktech.maven.publish"
29-
apply plugin: 'com.gradle.plugin-publish'
3028

3129
codeQualityTools {
3230
ktlint {
@@ -75,26 +73,20 @@ dependencies {
7573

7674
testImplementation 'junit:junit:4.13-beta-2'
7775
testImplementation 'org.assertj:assertj-core:3.12.0'
78-
testImplementation 'com.android.tools.build:gradle:3.3.1'
76+
testImplementation 'com.android.tools.build:gradle:4.0.2'
7977
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
8078
}
8179

8280
sourceCompatibility = JavaVersion.VERSION_1_7
8381

84-
pluginBundle {
85-
website = POM_URL
86-
vcsUrl = POM_SCM_URL
87-
88-
plugins {
89-
graphGeneratorDependencyPlugin {
90-
displayName = POM_NAME
91-
tags = ['gradle', 'graph', 'dependencies', 'graphviz', 'dot']
92-
description = POM_DESCRIPTION
93-
}
94-
}
95-
}
96-
9782
wrapper {
98-
gradleVersion = '5.2.1'
83+
gradleVersion = '6.8.3'
9984
distributionType = Wrapper.DistributionType.ALL
10085
}
86+
87+
test {
88+
testLogging {
89+
events "passed", "skipped", "failed"
90+
exceptionFormat "full"
91+
}
92+
}

gradle/wrapper/gradle-wrapper.jar

3.92 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 33 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 24 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ open class DependencyGraphGeneratorExtension(project: Project) {
6262
/** Allows to change the node for the given project. */
6363
@get:Input var projectNode: (MutableNode, Project) -> MutableNode = { node, _ -> node },
6464
/** Optional label that can be displayed wrapped around the graph. */
65-
@get:Internal var label: Label? = null, //Not serializable making it unusable as an Input
65+
@get:Internal var label: Label? = null, // Not serializable making it unusable as an Input
6666
/** Return true when you want to include this configuration, false otherwise. */
6767
@get:Input var includeConfiguration: (Configuration) -> Boolean = {
6868
// By default we'll include everything that's on the compileClassPath except test, UnitTest and AndroidTest configurations.

src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorPluginTest.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import org.junit.Rule
1212
import org.junit.Test
1313
import org.junit.rules.TemporaryFolder
1414
import java.io.File
15-
import java.io.StringWriter
1615

1716
class DependencyGraphGeneratorPluginTest {
1817
@get:Rule val testProjectDir = TemporaryFolder()
@@ -222,7 +221,6 @@ class DependencyGraphGeneratorPluginTest {
222221
}
223222

224223
// We don't want to assert the content of the image, just that it exists.
225-
assertThat(File(testProjectDir.root, "build/reports/dependency-graph/dependency-graph.png")).exists()
226224
assertThat(File(testProjectDir.root, "build/reports/dependency-graph/dependency-graph.svg")).exists()
227225

228226
assertThat(File(testProjectDir.root, "build/reports/dependency-graph/dependency-graph.dot")).hasContent("""
@@ -253,7 +251,6 @@ class DependencyGraphGeneratorPluginTest {
253251
}""".trimIndent())
254252

255253
// We don't want to assert the content of the image, just that it exists.
256-
assertThat(File(testProjectDir.root, "build/reports/project-dependency-graph/project-dependency-graph.png")).exists()
257254
assertThat(File(testProjectDir.root, "build/reports/project-dependency-graph/project-dependency-graph.svg")).exists()
258255

259256
assertThat(File(testProjectDir.root, "build/reports/project-dependency-graph/project-dependency-graph.dot")).hasContent("""

0 commit comments

Comments
 (0)