Skip to content

Commit 26232ce

Browse files
authored
Feature/gradle plugin portal publish (#2)
- Gradle Portal publishing - Use the new Plugins DSL
1 parent dd099b8 commit 26232ce

File tree

8 files changed

+49
-28
lines changed

8 files changed

+49
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ apply plugin: 'org.neotech.plugin.rootcoverage'
2323
buildscript {
2424
dependencies {
2525
// Step 1: add the dependency
26-
classpath 'org.neotech.plugin:android-root-coverage-plugin:1.0.0'
26+
classpath 'org.neotech.plugin:android-root-coverage-plugin:1.0.1'
2727
}
2828
}
2929
```

build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,6 @@ buildscript {
88
google()
99
jcenter()
1010
}
11-
dependencies {
12-
classpath projectDependency.gradlePlugin
13-
classpath projectDependency.kotlinPlugin
14-
15-
// Bintray & Maven for publishing
16-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
17-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
18-
19-
// NOTE: Do not place your application dependencies here; they belong
20-
// in the individual module build.gradle files
21-
}
2211
}
2312

2413
allprojects {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ org.gradle.jvmargs=-Xmx1536m
1919
#PACKAGING=jar
2020

2121
GROUP=org.neotech.plugin
22-
VERSION=1.0.0
22+
VERSION=1.0.1
2323
DESCRIPTION=A Gradle plugin for easy generation of combined code coverage reports for Android projects with multiple modules.
2424

2525
PROJECT_WEBSITE=https://github.com/NeoTech-Software/android-root-coverage-plugin

gradle/dependencies.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ext {
2525

2626
// Used by the plugin-version-handler.gradle
2727
pluginVersions = [
28-
"org.jetbrains.kotlin.android": "${projectVersion.kotlin}"
28+
"org.jetbrains.kotlin.android": "${projectVersion.kotlin}",
29+
"org.jetbrains.kotlin.jvm": "${projectVersion.kotlin}"
2930
]
3031
}

plugin/build.gradle

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
apply plugin: 'kotlin'
2-
apply plugin: 'java-gradle-plugin'
3-
apply plugin: 'maven'
1+
plugins {
2+
id "org.jetbrains.kotlin.jvm"
3+
id "java-gradle-plugin"
44

5-
// To upload new plugin artifact to maven:
6-
// > gradlew bintrayUpload
5+
// For publishing to Plugin Portal
6+
id "com.gradle.plugin-publish" version "0.10.0"
7+
8+
// Bintray & Maven for publishing
9+
id "com.github.dcendents.android-maven" version "2.1"
10+
id "com.jfrog.bintray" version "1.8.4"
11+
}
12+
13+
// To upload new plugin artifact to maven and Gradle Portal:
14+
// > gradlew bintrayUpload publishPlugins
715
//
816
// To test the plugin:
917
// > gradlew clean test
@@ -20,6 +28,25 @@ gradlePlugin {
2028
}
2129
}
2230

31+
pluginBundle {
32+
website = PROJECT_WEBSITE
33+
vcsUrl = 'https://github.com/NeoTech-Software/Android-Root-Coverage-Plugin'
34+
description = DESCRIPTION
35+
tags = ['android', 'coverage', 'jacoco', 'code-coverage', 'coverage-report', 'aggregated-report']
36+
37+
plugins {
38+
rootCoverage {
39+
displayName = 'Android-Root-Coverage-Plugin'
40+
}
41+
}
42+
43+
mavenCoordinates {
44+
groupId = GROUP
45+
artifactId = ARTIFACT_ID
46+
version = VERSION
47+
}
48+
}
49+
2350
dependencies {
2451
compileOnly gradleApi()
2552
implementation projectDependency.gradlePlugin

plugin/src/test/test-fixtures/multi-module/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ buildscript {
1717
}
1818

1919
plugins {
20-
// Prevent adding this plugin to all submodules (default behaviour)
21-
id 'org.neotech.plugin.rootcoverage' apply false
20+
id 'jacoco'
21+
id 'org.neotech.plugin.rootcoverage'
2222
}
23-
// Add the plugin just to this module
24-
apply plugin: 'jacoco'
25-
apply plugin: 'org.neotech.plugin.rootcoverage'
2623

2724
allprojects {
2825
repositories {

publish.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
apply plugin: 'maven'
1+
// This file only works if the project that includes it defines:
2+
// plugins {
3+
// id "com.github.dcendents.android-maven" version "2.1"
4+
// id "com.jfrog.bintray" version "1.8.4"
5+
// }
26

37
// project.archivesBaseName is added by the Maven plugin to the project, the value defaults to the
48
// project.name property, but since project.name is basically the current folder name the desired
@@ -88,9 +92,6 @@ artifacts {
8892
}
8993
}
9094

91-
// Bintray
92-
apply plugin: 'com.jfrog.bintray'
93-
9495
Properties properties = new Properties()
9596
properties.load(project.rootProject.file("local.properties").newDataInputStream())
9697

settings.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
// See plugin-version-handler.gradle for an explanation why this is here.
2+
pluginManagement {
3+
apply from: "gradle/plugin-version-handler.gradle", to: pluginManagement
4+
}
5+
6+
17
include ':plugin'

0 commit comments

Comments
 (0)