diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7000260 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,52 @@ +version: 2 +jobs: + build: + machine: + image: circleci/classic:latest + + environment: + # Customize the JVM maximum heap limit + # Needs to be updated along with gradle jvmargs 👇 + _JAVA_OPTIONS: "-Xmx2g" + + steps: + - checkout + + # Set the JVM heap size to gradle as well + - run: echo "org.gradle.jvmargs=-Xmx2G" >> gradle.properties + + # Download/Install Android SDK for testing + - run: wget -q https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip + - run: unzip -q sdk-tools-linux-3859397.zip + - run: mkdir $HOME/android-sdk + - run: mv tools $HOME/android-sdk/tools + - run: mkdir $HOME/android-sdk/licenses + - run: echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "$HOME/android-sdk/licenses/android-sdk-license" + - run: echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$HOME/android-sdk/licenses/android-sdk-preview-license" + + # Try to restore cache (see ho to save cache below 👇) + - restore_cache: + key: gradle-cache-v0-{{ checksum "build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }} + + - run: + environment: + ANDROID_HOME: "/home/circleci/android-sdk" # TODO: Try to don't hardcode me and use $HOME env variable + command: ./gradlew test --no-daemon + + # Save the gradle folder for caching + - save_cache: + paths: + - ~/.gradle + key: gradle-cache-v0-{{ checksum "build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }} + + - run: + command: | + cd samples + echo "sdk.dir=$HOME/android-sdk" >> local.properties + ./gradlew clean build bintrayUpload -PbintrayUser=user -PbintrayKey=secret -PdryRun=true --info + +workflows: + version: 2 + build: + jobs: + - build diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 2ecc09a..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -# Change Log # - -See [Releases](https://github.com/novoda/bintray-release/releases) for all versions and change log. \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index 9fc83a7..dc5ab6a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ - Copyright 2014 Novoda Ltd + Copyright 2014 Novoda Ltd & Stefan M. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 9b8d9cc..8c84a4b 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,72 @@ -# bintray-release [![](https://ci.novoda.com/buildStatus/icon?job=bintray-release)](https://ci.novoda.com/job/bintray-release/lastBuild/console) [![Download](https://api.bintray.com/packages/novoda/maven/bintray-release/images/download.svg) ](https://bintray.com/novoda/maven/bintray-release/_latestVersion) [![](https://raw.githubusercontent.com/novoda/novoda/master/assets/btn_apache_lisence.png)](LICENSE.txt) - -Super duper easy way to release your Android and other artifacts to bintray. +[![CircleCI](https://circleci.com/gh/StefMa/bintray-release.svg?style=svg)](https://circleci.com/gh/StefMa/bintray-release) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +# BintrayRelease +A super duper easy way to release your Android and Java artifacts to [Bintray](https://bintray.com). ## Description +This is a helper for releasing Android and Java libraries to Bintray. +Basically it is "just" a wrapper around the [Gradle-Bintray-Plugin](https://github.com/bintray/gradle-bintray-plugin) and the [AndroidArtifacts Plugin](https://github.com/StefMa/AndroidArtifacts). -This is a helper for releasing libraries to bintray. It is intended to help configuring stuff related to maven and bintray. -At the moment it works with Android Library projects, plain Java and plain Groovy projects, but our focus is to mainly support Android projects. +The Plugin configure all artifacts for you and hock it into the `Gradle-Bintay-Plugin`. -## Adding to project +At this time of writing it supports "all Android" libraries which will be supported by the `AndroidArtifacts` Plugin. +Beside of that it will create artifacts for Java libraries. But later this should be part of the `AndroidArtifacts` Plugin. -To publish a library to bintray using this plugin, add these dependencies to the `build.gradle` of the module that will be published: +## How to use it +### Apply the Plugin +Put the following lines to your **project** `build.gradle`: ```groovy -apply plugin: 'com.novoda.bintray-release' // must be applied after your artifact generating plugin (eg. java / com.android.library) +apply plugin: "com.android.library" +apply plugin: "guru.stefma.bintrayrelease" //1 buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.novoda:bintray-release:' + // The current version can be found here https://git.io/fNUnx + classpath "guru.stefma.bintrayrelease:bintrayrelease:$bintrayReleaseVersion" } } ``` -## Simple usage - -Use the `publish` closure to set the info of your package: +### Configure the `publish` extension +The Plugin brings a `publish` extension which needs to be setup in your **module** `build.gradle` in the following way: ```groovy +version = "1.0.0" +group = "guru.stefma.bintrayrelease" publish { - userOrg = 'novoda' - groupId = 'com.novoda' - artifactId = 'bintray-release' - publishVersion = '0.6.1' + userOrg = 'stefma' + artifactId = 'bintrayrelease' desc = 'Oh hi, this is a nice description for a project, right?' - website = 'https://github.com/novoda/bintray-release' + website = 'https://github.com/stefma/bintray-release' } -``` - -If you use [Kotlin DSL](https://github.com/gradle/kotlin-dsl) use: - -```kotlin -import com.novoda.gradle.release.PublishExtension -configure { - userOrg = "novoda" - groupId = "com.novoda" - artifactId = "bintray-release" - publishVersion = "0.6.1" - desc = "Oh hi, this is a nice description for a project, right?" - website = "https://github.com/novoda/bintray-release" -} ``` +### Publish Finally, use the task `bintrayUpload` to publish (make sure you build the project first!): -```bash -$ ./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false +``` +./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false ``` -More info on the available properties and other usages in the [Github Wiki](https://github.com/novoda/bintray-release/wiki). - -## Gradle compatibility -| bintray-release version | Java Projects | Android Projects | -|-------------------------|---------------|------------------| -| 0.8.* | Gradle 4.0+ | Gradle 4.1+ | - -> **Notes:** Currently Gradle 4.5 doesn't work with Android projects +## About the Fork +This is a fork of the original [`bintray-release`](https://github.com/novoda/bintray-release) of [**novoda**](https://novoda.com/). +I started to create and maintain this fork (instead of contribute there) because I wanted to have the "full control" over the project. +Beside of this this fork use another Plugin as dependency which I've developed by myself. To keep it regularly in sync with +the "upstream Plugin" I thought it is easy to have a Plugin which is owned by me. -## Links +### License +Because it is a fork of the `bintray-release` (which is original licensed under the `Apache-2`) I decided to license these +Plugin under the Apache-2 as well. -Here are a list of useful links: +I don't want to violence the Apache-2. But I'm also not a lawyer. Because of this - and the lack of knowledge - I decided to keep +**novoda** inside the [LICENSE](LICENSE.txt). - * We always welcome people to contribute new features or bug fixes, [here is how](https://github.com/novoda/novoda/blob/master/CONTRIBUTING.md) - * If you have a problem check the [Issues Page](https://github.com/novoda/bintray-release/issues) first to see if we are working on it - * For further usage or to delve more deeply checkout the [Project Wiki](https://github.com/novoda/bintray-release/wiki) - * Looking for community help, browse the already asked [Stack Overflow Questions](http://stackoverflow.com/questions/tagged/support-bintray-release) or use the tag: `support-bintray-release` when posting a new question +But not all code in this Plugin is original "novoda code". I started the fork at the commit [`0d998ad`](https://github.com/StefMa/bintray-release/commit/0d998ad9cf4f822be2bcbffaf02bbee881f13101). +Feel free to compare the latest version with the commit to see a diff about "what is new and what is original novoda software". diff --git a/ci/prBuilder.sh b/ci/prBuilder.sh deleted file mode 100755 index 74902f1..0000000 --- a/ci/prBuilder.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -BASEDIR=$(dirname "$0") - -# Testing the core plugin -cd $BASEDIR/../ && ./gradlew clean build bintrayUpload -PdryRun=true --info - -# Testing the samples -cd $BASEDIR/../samples/ && ./gradlew clean build bintrayUpload -PdryRun=true --info diff --git a/core/README.md b/core/README.md deleted file mode 100644 index 340abbc..0000000 --- a/core/README.md +++ /dev/null @@ -1,6 +0,0 @@ -This is the module for the source code of the `bintray-release` plugin. - -The entry point for this code is the [ReleasePlugin.groovy](src/main/groovy/com/novoda/gradle/release/ReleasePlugin.groovy) class. -If this is your first time, you'll probably want to start there. - -If you want to test your code changes you make here, see the [samples module](../samples/) diff --git a/core/build.gradle b/core/build.gradle index 1949d61..7e11ced 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,17 +1,21 @@ plugins { - id 'com.novoda.bintray-release' version "0.8.0" id 'groovy' id 'java-gradle-plugin' + id 'java-library' + id 'guru.stefma.bintrayrelease' version "1.0.0" apply false id 'maven' } +apply plugin: "guru.stefma.bintrayrelease" repositories { + google() jcenter() } dependencies { compile localGroovy() - compile 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' + compile 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' + compile 'guru.stefma.androidartifacts:androidartifacts:1.0.0' testCompile 'junit:junit:4.12' testCompile 'org.assertj:assertj-core:3.9.0' @@ -25,21 +29,18 @@ compileGroovy { gradlePlugin { plugins { binrayRelease { - id = "com.novoda.bintray-release" - implementationClass = "com.novoda.gradle.release.ReleasePlugin" - } - legacy { - id = "bintray-release" - implementationClass = "com.novoda.gradle.release.ReleasePlugin" + id = "guru.stefma.bintrayrelease" + implementationClass = "guru.stefma.bintrayrelease.ReleasePlugin" } } } +version = "1.0.0" +group = "guru.stefma.bintrayrelease" publish { - userOrg = 'novoda' - groupId = 'com.novoda' - artifactId = rootProject.name - publishVersion = '0.8.1' + userOrg = 'stefma' + artifactId = "bintrayrelease" + uploadName = "BintrayRelease" desc = 'Super duper easy way to release your Android and other artifacts to bintray' - website = "https://github.com/novoda/${rootProject.name}" + website = "https://github.com/stefma/bintray-release" } diff --git a/core/src/main/groovy/com/novoda/gradle/release/AndroidArtifacts.groovy b/core/src/main/groovy/com/novoda/gradle/release/AndroidArtifacts.groovy deleted file mode 100644 index f573560..0000000 --- a/core/src/main/groovy/com/novoda/gradle/release/AndroidArtifacts.groovy +++ /dev/null @@ -1,54 +0,0 @@ -package com.novoda.gradle.release - -import org.gradle.api.Project -import org.gradle.api.tasks.bundling.Jar -import org.gradle.api.tasks.javadoc.Javadoc - -class AndroidArtifacts implements Artifacts { - - def variant - - AndroidArtifacts(variant) { - this.variant = variant - } - - def all(String publicationName, Project project) { - [sourcesJar(project), javadocJar(project), mainJar(project)] - } - - def sourcesJar(Project project) { - project.task(variant.name + 'AndroidSourcesJar', type: Jar) { - classifier = 'sources' - variant.sourceSets.each { - from it.java.srcDirs - } - } - } - - def javadocJar(Project project) { - def androidJavadocs = project.task(variant.name + 'AndroidJavadocs', type: Javadoc) { - variant.sourceSets.each { - delegate.source it.java.srcDirs - } - classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator)) - classpath += variant.javaCompile.classpath - classpath += variant.javaCompile.outputs.files - } - - project.task(variant.name + 'AndroidJavadocsJar', type: Jar, dependsOn: androidJavadocs) { - classifier = 'javadoc' - from androidJavadocs.destinationDir - } - } - - def mainJar(Project project) { - def archiveBaseName = project.hasProperty("archivesBaseName") ? project.getProperty("archivesBaseName") : project.name - "$project.buildDir/outputs/aar/$archiveBaseName-${variant.baseName}.aar" - } - - def from(Project project) { - project.components.add(new AndroidLibrary(project)) - project.components.android - } - -} diff --git a/core/src/main/groovy/com/novoda/gradle/release/AndroidLibrary.groovy b/core/src/main/groovy/com/novoda/gradle/release/AndroidLibrary.groovy deleted file mode 100644 index 6889b8e..0000000 --- a/core/src/main/groovy/com/novoda/gradle/release/AndroidLibrary.groovy +++ /dev/null @@ -1,82 +0,0 @@ -package com.novoda.gradle.release - -import org.gradle.api.DomainObjectSet -import org.gradle.api.Project -import org.gradle.api.UnknownDomainObjectException -import org.gradle.api.artifacts.Dependency -import org.gradle.api.artifacts.ModuleDependency -import org.gradle.api.artifacts.PublishArtifact -import org.gradle.api.attributes.Usage -import org.gradle.api.internal.DefaultDomainObjectSet -import org.gradle.api.internal.component.SoftwareComponentInternal -import org.gradle.api.internal.component.UsageContext -import org.gradle.api.model.ObjectFactory -import org.gradle.util.GradleVersion - -class AndroidLibrary implements SoftwareComponentInternal { - - private final String CONF_COMPILE = "compile" - private final String CONF_API = "api" - private final String CONF_IMPLEMENTATION = "implementation" - - private final Set usages = new DefaultDomainObjectSet(UsageContext) - - AndroidLibrary(Project project) { - ObjectFactory objectFactory = project.getObjects() - - // Using the new Usage in 4.1 will make the plugin crash - // as comparing logic is still using the old Usage. - // For more details: https://github.com/novoda/bintray-release/pull/147 - def isNewerThan4_1 = GradleVersion.current() > GradleVersion.version("4.1") - Usage api = objectFactory.named(Usage.class, isNewerThan4_1 ? Usage.JAVA_API : "for compile") - Usage runtime = objectFactory.named(Usage.class, isNewerThan4_1 ? Usage.JAVA_RUNTIME : "for runtime") - - addUsageContextFromConfiguration(project, CONF_COMPILE, api) - addUsageContextFromConfiguration(project, CONF_API, api) - addUsageContextFromConfiguration(project, CONF_IMPLEMENTATION, runtime) - } - - String getName() { - return "android" - } - - Set getUsages() { - return usages - } - - private addUsageContextFromConfiguration(Project project, String configuration, Usage usage) { - try { - def configurationObj = project.configurations.getByName(configuration) - def dependency = configurationObj.dependencies - if (!dependency.isEmpty()) { - def libraryUsage = new LibraryUsage(dependency, usage) - usages.add(libraryUsage) - } - } catch (UnknownDomainObjectException ignore) { - // cannot find configuration - } - } - - private static class LibraryUsage implements UsageContext { - - private final DomainObjectSet dependencies - private final Usage usage - - LibraryUsage(DomainObjectSet dependencies, Usage usage) { - this.usage = usage - this.dependencies = dependencies - } - - Usage getUsage() { - return usage - } - - Set getArtifacts() { - new LinkedHashSet() - } - - Set getDependencies() { - dependencies.withType(ModuleDependency) - } - } -} diff --git a/core/src/main/groovy/com/novoda/gradle/release/Artifacts.groovy b/core/src/main/groovy/com/novoda/gradle/release/Artifacts.groovy deleted file mode 100644 index b28de39..0000000 --- a/core/src/main/groovy/com/novoda/gradle/release/Artifacts.groovy +++ /dev/null @@ -1,9 +0,0 @@ -package com.novoda.gradle.release; - -import org.gradle.api.Project - -interface Artifacts { - - def all(String publicationName, Project project) - -} diff --git a/core/src/main/groovy/com/novoda/gradle/release/ReleasePlugin.groovy b/core/src/main/groovy/com/novoda/gradle/release/ReleasePlugin.groovy deleted file mode 100644 index 5a82114..0000000 --- a/core/src/main/groovy/com/novoda/gradle/release/ReleasePlugin.groovy +++ /dev/null @@ -1,47 +0,0 @@ -package com.novoda.gradle.release - -import com.jfrog.bintray.gradle.BintrayPlugin -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.publish.maven.MavenPublication - -class ReleasePlugin implements Plugin { - - @Override - void apply(Project project) { - PublishExtension extension = project.extensions.create('publish', PublishExtension) - project.afterEvaluate { - extension.validate() - project.apply([plugin: 'maven-publish']) - attachArtifacts(extension, project) - new BintrayPlugin().apply(project) - new BintrayConfiguration(extension).configure(project) - } - } - - void attachArtifacts(PublishExtension extension, Project project) { - if (project.plugins.hasPlugin('com.android.library')) { - project.android.libraryVariants.all { variant -> - def artifactId = extension.artifactId; - addArtifact(project, variant.name, artifactId, new AndroidArtifacts(variant)) - } - } else { - addArtifact(project, 'maven', project.publish.artifactId, new JavaArtifacts()) - } - } - - - void addArtifact(Project project, String name, String artifact, Artifacts artifacts) { - PropertyFinder propertyFinder = new PropertyFinder(project, project.publish) - project.publishing.publications.create(name, MavenPublication) { - groupId project.publish.groupId - artifactId artifact - version = propertyFinder.publishVersion - - artifacts.all(it.name, project).each { - delegate.artifact it - } - from artifacts.from(project) - } - } -} diff --git a/core/src/main/groovy/guru/stefma/bintrayrelease/AndroidPublishExtension.groovy b/core/src/main/groovy/guru/stefma/bintrayrelease/AndroidPublishExtension.groovy new file mode 100644 index 0000000..161edcf --- /dev/null +++ b/core/src/main/groovy/guru/stefma/bintrayrelease/AndroidPublishExtension.groovy @@ -0,0 +1,18 @@ +package guru.stefma.bintrayrelease + +import guru.stefma.androidartifacts.AndroidArtifactsExtension + +class AndroidPublishExtension extends PublishExtension { + + private AndroidArtifactsExtension mAndroidExtension + + AndroidPublishExtension(AndroidArtifactsExtension androidArtifactsExtension) { + mAndroidExtension = androidArtifactsExtension + } + + @Override + void setArtifactId(String newArtifactId) { + super.setArtifactId(newArtifactId) + mAndroidExtension.artifactId = newArtifactId + } +} diff --git a/core/src/main/groovy/com/novoda/gradle/release/BintrayConfiguration.groovy b/core/src/main/groovy/guru/stefma/bintrayrelease/BintrayConfiguration.groovy similarity index 91% rename from core/src/main/groovy/com/novoda/gradle/release/BintrayConfiguration.groovy rename to core/src/main/groovy/guru/stefma/bintrayrelease/BintrayConfiguration.groovy index f8f3819..22abb40 100644 --- a/core/src/main/groovy/com/novoda/gradle/release/BintrayConfiguration.groovy +++ b/core/src/main/groovy/guru/stefma/bintrayrelease/BintrayConfiguration.groovy @@ -1,4 +1,4 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease import org.gradle.api.Project @@ -23,7 +23,7 @@ class BintrayConfiguration { dryRun = propertyFinder.dryRun override = propertyFinder.override - publications = extension.publications ?: project.plugins.hasPlugin('com.android.library') ? ['release'] : [ 'maven' ] + publications = extension.publications ?: project.plugins.hasPlugin('com.android.library') ? ['releaseAar'] : [ 'maven' ] pkg { repo = extension.repoName @@ -36,7 +36,7 @@ class BintrayConfiguration { licenses = extension.licences version { - name = propertyFinder.publishVersion + name = project.version attributes = extension.versionAttributes } } @@ -64,7 +64,7 @@ class BintrayConfiguration { def gradlePluginPropertyFinder = new GradlePluginPropertyFinder(project) String bestPluginId = gradlePluginPropertyFinder.findBestGradlePluginId() if (bestPluginId != null) { - extension.versionAttributes << ['gradle-plugin': "$bestPluginId:$extension.groupId:$extension.artifactId"] + extension.versionAttributes << ['gradle-plugin': "$bestPluginId:$project.group:$extension.artifactId"] project.logger.info "Using plugin identifier '" + extension.versionAttributes.get('gradle-plugins') + "' for gradle portal." } } diff --git a/core/src/main/groovy/com/novoda/gradle/release/GradlePluginPropertyFinder.groovy b/core/src/main/groovy/guru/stefma/bintrayrelease/GradlePluginPropertyFinder.groovy similarity index 97% rename from core/src/main/groovy/com/novoda/gradle/release/GradlePluginPropertyFinder.groovy rename to core/src/main/groovy/guru/stefma/bintrayrelease/GradlePluginPropertyFinder.groovy index 185fae6..b6706c2 100644 --- a/core/src/main/groovy/com/novoda/gradle/release/GradlePluginPropertyFinder.groovy +++ b/core/src/main/groovy/guru/stefma/bintrayrelease/GradlePluginPropertyFinder.groovy @@ -1,4 +1,4 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease import org.gradle.api.Project import org.gradle.api.file.FileCollection diff --git a/core/src/main/groovy/com/novoda/gradle/release/JavaArtifacts.groovy b/core/src/main/groovy/guru/stefma/bintrayrelease/JavaArtifacts.groovy similarity index 90% rename from core/src/main/groovy/com/novoda/gradle/release/JavaArtifacts.groovy rename to core/src/main/groovy/guru/stefma/bintrayrelease/JavaArtifacts.groovy index 3376bcd..44a794f 100644 --- a/core/src/main/groovy/com/novoda/gradle/release/JavaArtifacts.groovy +++ b/core/src/main/groovy/guru/stefma/bintrayrelease/JavaArtifacts.groovy @@ -1,9 +1,9 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease import org.gradle.api.Project import org.gradle.api.tasks.bundling.Jar -class JavaArtifacts implements Artifacts { +class JavaArtifacts { def all(String publicationName, Project project) { [sourcesJar(publicationName, project), javadocJar(publicationName, project)] diff --git a/core/src/main/groovy/com/novoda/gradle/release/PropertyFinder.groovy b/core/src/main/groovy/guru/stefma/bintrayrelease/PropertyFinder.groovy similarity index 96% rename from core/src/main/groovy/com/novoda/gradle/release/PropertyFinder.groovy rename to core/src/main/groovy/guru/stefma/bintrayrelease/PropertyFinder.groovy index 39e3cda..0f87f6b 100644 --- a/core/src/main/groovy/com/novoda/gradle/release/PropertyFinder.groovy +++ b/core/src/main/groovy/guru/stefma/bintrayrelease/PropertyFinder.groovy @@ -1,4 +1,4 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease import org.gradle.api.Project; @@ -17,6 +17,7 @@ class PropertyFinder { } def getBintrayKey() { + getString(project, 'bintrayKey', extension.bintrayKey) } diff --git a/core/src/main/groovy/com/novoda/gradle/release/PublishExtension.groovy b/core/src/main/groovy/guru/stefma/bintrayrelease/PublishExtension.groovy similarity index 84% rename from core/src/main/groovy/com/novoda/gradle/release/PublishExtension.groovy rename to core/src/main/groovy/guru/stefma/bintrayrelease/PublishExtension.groovy index b3cca1d..887c72a 100644 --- a/core/src/main/groovy/com/novoda/gradle/release/PublishExtension.groovy +++ b/core/src/main/groovy/guru/stefma/bintrayrelease/PublishExtension.groovy @@ -1,4 +1,4 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease import groovy.transform.PackageScope @@ -18,10 +18,15 @@ class PublishExtension { String repoName = 'maven' String userOrg - String groupId - String artifactId + private String artifactId - String publishVersion + void setArtifactId(String newArtifactId) { + artifactId = newArtifactId + } + + String getArtifactId() { + return artifactId + } Map versionAttributes = [:] @@ -54,15 +59,9 @@ class PublishExtension { if (userOrg == null) { extensionError += "Missing userOrg. " } - if (groupId == null) { - extensionError += "Missing groupId. " - } if (artifactId == null) { extensionError += "Missing artifactId. " } - if (publishVersion == null) { - extensionError += "Missing publishVersion. " - } if (desc == null) { extensionError += "Missing desc. " } diff --git a/core/src/main/groovy/guru/stefma/bintrayrelease/ReleasePlugin.groovy b/core/src/main/groovy/guru/stefma/bintrayrelease/ReleasePlugin.groovy new file mode 100644 index 0000000..a2e51f7 --- /dev/null +++ b/core/src/main/groovy/guru/stefma/bintrayrelease/ReleasePlugin.groovy @@ -0,0 +1,52 @@ +package guru.stefma.bintrayrelease + +import com.jfrog.bintray.gradle.BintrayPlugin +import guru.stefma.androidartifacts.AndroidArtifactsExtension +import guru.stefma.androidartifacts.AndroidArtifactsPlugin +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.publish.maven.MavenPublication + +class ReleasePlugin implements Plugin { + + @Override + void apply(Project project) { + PublishExtension extension + if (project.plugins.hasPlugin('com.android.library')) { + project.plugins.apply(AndroidArtifactsPlugin.class) + def artifactsExtension = project.extensions.getByType(AndroidArtifactsExtension.class) + extension = project.extensions.create('publish', AndroidPublishExtension, artifactsExtension) + } + if (project.plugins.hasPlugin("java-library")) { + extension = project.extensions.create('publish', PublishExtension) + } + + new BintrayPlugin().apply(project) + project.afterEvaluate { + extension.validate() + if (project.plugins.hasPlugin("java-library")) { + attachJavaArtifacts(extension, project) + } + new BintrayConfiguration(extension).configure(project) + } + } + + void attachJavaArtifacts(PublishExtension extension, Project project) { + project.apply([plugin: 'maven-publish']) + addArtifact(project, 'maven', project.publish.artifactId, new JavaArtifacts()) + } + + void addArtifact(Project project, String name, String artifact, JavaArtifacts artifacts) { + PropertyFinder propertyFinder = new PropertyFinder(project, project.publish) + project.publishing.publications.create(name, MavenPublication) { + groupId project.group + artifactId artifact + version = project.version + + artifacts.all(it.name, project).each { + delegate.artifact it + } + from artifacts.from(project) + } + } +} diff --git a/core/src/test/groovy/com/novoda/gradle/release/TestGeneratePomTask.groovy b/core/src/test/groovy/com/novoda/gradle/release/TestGeneratePomTask.groovy deleted file mode 100644 index 6053782..0000000 --- a/core/src/test/groovy/com/novoda/gradle/release/TestGeneratePomTask.groovy +++ /dev/null @@ -1,132 +0,0 @@ -package com.novoda.gradle.release - -import org.gradle.testkit.runner.GradleRunner -import org.junit.Before -import org.junit.Rule -import org.junit.Test -import org.junit.rules.TemporaryFolder - -import static org.gradle.testkit.runner.TaskOutcome.SUCCESS - -class TestGeneratePomTask { - - @Rule public TemporaryFolder testProjectDir = new TemporaryFolder() - private File buildFile - - @Before - void setup() { - buildFile = testProjectDir.newFile('build.gradle') - } - - @Test - void testGeneratePomTaskForJavaLib() { - buildFile << """ - plugins { - id 'java-library' - id 'bintray-release' - } - - publish { - userOrg = 'novoda' - groupId = 'com.novoda' - artifactId = 'test' - publishVersion = '1.0' - desc = 'description' - } - - dependencies { - compile 'com.abc:hello:1.0.0' - implementation 'com.xyz:world:2.0.0' - api 'com.xxx:haha:3.0.0' - } - """ - - def result = GradleRunner.create() - .withProjectDir(testProjectDir.root) - .withArguments("generatePomFileForMavenPublication") - .withPluginClasspath() - .build() - - assert result.task(":generatePomFileForMavenPublication").outcome == SUCCESS - - File pomFile = new File(testProjectDir.root, '/build/publications/maven/pom-default.xml') - def nodes = new XmlSlurper().parse(pomFile) - def dependencies = nodes.dependencies.dependency - - assert dependencies.size() == 3 - assert dependencies.find { dep -> dep.artifactId == "hello" && dep.scope == "compile" } != null - assert dependencies.find { dep -> dep.artifactId == "haha" && dep.scope == "compile" } != null - assert dependencies.find { dep -> dep.artifactId == "world" && dep.scope == "runtime" } != null - } - - @Test - void testGeneratePomTaskForAndroidLibrary() { - File manifestFile = new File(testProjectDir.root, "/src/main/AndroidManifest.xml") - manifestFile.getParentFile().mkdirs() - manifestFile.createNewFile() - manifestFile << """ - - """ - - buildFile << """ - buildscript { - repositories { - jcenter() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.0.0' - } - } - - plugins { - id 'bintray-release' apply false - } - - apply plugin: "com.android.library" - apply plugin: "bintray-release" - - android { - compileSdkVersion 26 - buildToolsVersion "26.0.2" - - defaultConfig { - minSdkVersion 16 - versionCode 1 - versionName "0.0.1" - } - } - - publish { - userOrg = 'novoda' - groupId = 'com.novoda' - artifactId = 'test' - publishVersion = '1.0' - desc = 'description' - } - - dependencies { - compile 'com.abc:hello:1.0.0' - implementation 'com.xyz:world:2.0.0' - api 'com.xxx:haha:3.0.0' - } - """ - - def result = GradleRunner.create() - .withProjectDir(testProjectDir.root) - .withArguments("generatePomFileForReleasePublication") - .withPluginClasspath() - .build() - - assert result.task(":generatePomFileForReleasePublication").outcome == SUCCESS - - File pomFile = new File(testProjectDir.root, '/build/publications/release/pom-default.xml') - def nodes = new XmlSlurper().parse(pomFile) - def dependencies = nodes.dependencies.dependency - - assert dependencies.size() == 3 - assert dependencies.find { dep -> dep.artifactId == "hello" && dep.scope == "compile" } != null - assert dependencies.find { dep -> dep.artifactId == "haha" && dep.scope == "compile" } != null - assert dependencies.find { dep -> dep.artifactId == "world" && dep.scope == "runtime" } != null - } -} \ No newline at end of file diff --git a/core/src/test/groovy/com/novoda/gradle/release/AndroidDifferentGradleVersions.groovy b/core/src/test/groovy/guru/stefma/bintrayrelease/AndroidDifferentGradleVersions.groovy similarity index 69% rename from core/src/test/groovy/com/novoda/gradle/release/AndroidDifferentGradleVersions.groovy rename to core/src/test/groovy/guru/stefma/bintrayrelease/AndroidDifferentGradleVersions.groovy index 46a1bdf..1a1f937 100644 --- a/core/src/test/groovy/com/novoda/gradle/release/AndroidDifferentGradleVersions.groovy +++ b/core/src/test/groovy/guru/stefma/bintrayrelease/AndroidDifferentGradleVersions.groovy @@ -1,6 +1,6 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease -import com.novoda.gradle.release.rule.TestProjectRule +import guru.stefma.bintrayrelease.rule.TestProjectRule import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome import org.junit.Rule @@ -19,15 +19,12 @@ class AndroidDifferentGradleVersions { @Parameterized.Parameters(name = "{index}: test Gradle version {0}") static Collection gradleVersionExpectedOutcome() { return [ - // Gradle 4.0 is not support by the Android Gradle Plugin 3.x - new GradleVerionsParams(gradleVersion: "4.0", expectedGradleBuildFailure: true), - new GradleVerionsParams(gradleVersion: "4.1", expectedTaskOutcome: TaskOutcome.SUCCESS), - new GradleVerionsParams(gradleVersion: "4.2", expectedTaskOutcome: TaskOutcome.SUCCESS), - new GradleVerionsParams(gradleVersion: "4.3", expectedTaskOutcome: TaskOutcome.SUCCESS), - new GradleVerionsParams(gradleVersion: "4.4", expectedTaskOutcome: TaskOutcome.SUCCESS), - // TODO: Failure on Gradle 4.5. is **not** expected. It's failing because of changes in - // the UsageContext in our AndroidLibrary class - new GradleVerionsParams(gradleVersion: "4.5", expectedGradleBuildFailure: true), + new GradleVerionsParams(gradleVersion: "4.5", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.5.1", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.6", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.7", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.8", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.8.1", expectedTaskOutcome: TaskOutcome.SUCCESS), ] } diff --git a/core/src/test/groovy/com/novoda/gradle/release/GradleVerionsParams.groovy b/core/src/test/groovy/guru/stefma/bintrayrelease/GradleVerionsParams.groovy similarity index 93% rename from core/src/test/groovy/com/novoda/gradle/release/GradleVerionsParams.groovy rename to core/src/test/groovy/guru/stefma/bintrayrelease/GradleVerionsParams.groovy index fa56bb6..42656c6 100644 --- a/core/src/test/groovy/com/novoda/gradle/release/GradleVerionsParams.groovy +++ b/core/src/test/groovy/guru/stefma/bintrayrelease/GradleVerionsParams.groovy @@ -1,4 +1,4 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease import org.gradle.testkit.runner.TaskOutcome diff --git a/core/src/test/groovy/com/novoda/gradle/release/JavaDifferentGradleVersions.groovy b/core/src/test/groovy/guru/stefma/bintrayrelease/JavaDifferentGradleVersions.groovy similarity index 76% rename from core/src/test/groovy/com/novoda/gradle/release/JavaDifferentGradleVersions.groovy rename to core/src/test/groovy/guru/stefma/bintrayrelease/JavaDifferentGradleVersions.groovy index 0292fc7..07bc79a 100644 --- a/core/src/test/groovy/com/novoda/gradle/release/JavaDifferentGradleVersions.groovy +++ b/core/src/test/groovy/guru/stefma/bintrayrelease/JavaDifferentGradleVersions.groovy @@ -1,6 +1,6 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease -import com.novoda.gradle.release.rule.TestProjectRule +import guru.stefma.bintrayrelease.rule.TestProjectRule import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome import org.junit.Rule @@ -25,6 +25,11 @@ class JavaDifferentGradleVersions { new GradleVerionsParams(gradleVersion: "4.3", expectedTaskOutcome: TaskOutcome.SUCCESS), new GradleVerionsParams(gradleVersion: "4.4", expectedTaskOutcome: TaskOutcome.SUCCESS), new GradleVerionsParams(gradleVersion: "4.5", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.5.1", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.6", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.7", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.8", expectedTaskOutcome: TaskOutcome.SUCCESS), + new GradleVerionsParams(gradleVersion: "4.8.1", expectedTaskOutcome: TaskOutcome.SUCCESS), ] } diff --git a/core/src/test/groovy/com/novoda/gradle/release/TestBintrayUploadTask.groovy b/core/src/test/groovy/guru/stefma/bintrayrelease/TestBintrayUploadTask.groovy similarity index 96% rename from core/src/test/groovy/com/novoda/gradle/release/TestBintrayUploadTask.groovy rename to core/src/test/groovy/guru/stefma/bintrayrelease/TestBintrayUploadTask.groovy index 9f8af69..94112c1 100644 --- a/core/src/test/groovy/com/novoda/gradle/release/TestBintrayUploadTask.groovy +++ b/core/src/test/groovy/guru/stefma/bintrayrelease/TestBintrayUploadTask.groovy @@ -1,9 +1,10 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.BuildTask import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome +import org.junit.Ignore import org.junit.Test public class TestBintrayUploadTask { diff --git a/core/src/test/groovy/guru/stefma/bintrayrelease/TestGeneratePomTask.groovy b/core/src/test/groovy/guru/stefma/bintrayrelease/TestGeneratePomTask.groovy new file mode 100644 index 0000000..d6a98af --- /dev/null +++ b/core/src/test/groovy/guru/stefma/bintrayrelease/TestGeneratePomTask.groovy @@ -0,0 +1,63 @@ +package guru.stefma.bintrayrelease + +import org.gradle.testkit.runner.GradleRunner +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.rules.TemporaryFolder + +import static org.gradle.testkit.runner.TaskOutcome.SUCCESS + +class TestGeneratePomTask { + + @Rule + public TemporaryFolder testProjectDir = new TemporaryFolder() + + private File buildFile + + @Before + void setup() { + buildFile = testProjectDir.newFile('build.gradle') + } + + @Test + void testGeneratePomTaskForJavaLib() { + buildFile << """ + plugins { + id 'java-library' + id 'guru.stefma.bintrayrelease' + } + + group = "guru.stefma" + version = "1.0" + publish { + userOrg = 'stefma' + artifactId = 'test' + desc = 'description' + } + + dependencies { + compile 'com.abc:hello:1.0.0' + implementation 'com.xyz:world:2.0.0' + api 'com.xxx:haha:3.0.0' + } + """ + + def result = GradleRunner.create() + .withProjectDir(testProjectDir.root) + .withArguments("generatePomFileForMavenPublication") + .withPluginClasspath() + .build() + + assert result.task(":generatePomFileForMavenPublication").outcome == SUCCESS + + File pomFile = new File(testProjectDir.root, '/build/publications/maven/pom-default.xml') + def nodes = new XmlSlurper().parse(pomFile) + def dependencies = nodes.dependencies.dependency + + assert dependencies.size() == 3 + assert dependencies.find { dep -> dep.artifactId == "hello" && dep.scope == "compile" } != null + assert dependencies.find { dep -> dep.artifactId == "haha" && dep.scope == "compile" } != null + assert dependencies.find { dep -> dep.artifactId == "world" && dep.scope == "runtime" } != null + } +} \ No newline at end of file diff --git a/core/src/test/groovy/com/novoda/gradle/release/TestInvalidExtensionSetup.groovy b/core/src/test/groovy/guru/stefma/bintrayrelease/TestInvalidExtensionSetup.groovy similarity index 71% rename from core/src/test/groovy/com/novoda/gradle/release/TestInvalidExtensionSetup.groovy rename to core/src/test/groovy/guru/stefma/bintrayrelease/TestInvalidExtensionSetup.groovy index f04aaa2..cf45ffb 100644 --- a/core/src/test/groovy/com/novoda/gradle/release/TestInvalidExtensionSetup.groovy +++ b/core/src/test/groovy/guru/stefma/bintrayrelease/TestInvalidExtensionSetup.groovy @@ -1,8 +1,6 @@ -package com.novoda.gradle.release +package guru.stefma.bintrayrelease -import com.novoda.gradle.release.rule.TestProjectRule -import org.assertj.core.api.Assertions -import org.gradle.testkit.runner.BuildResult +import guru.stefma.bintrayrelease.rule.TestProjectRule import org.gradle.testkit.runner.GradleRunner import org.junit.Rule import org.junit.Test @@ -17,14 +15,14 @@ class TestInvalidExtensionSetup { private String buildScript = """ plugins { id 'java-library' - id 'com.novoda.bintray-release' + id 'guru.stefma.bintrayrelease' } + group = "guru.stefma" + version = "1.0" publish { - userOrg = 'novoda' - groupId = 'com.novoda' + userOrg = 'stefma' artifactId = 'test' - // publishVersion = '1.0' // desc = 'description' } """ @@ -40,6 +38,6 @@ class TestInvalidExtensionSetup { .withPluginClasspath() .buildAndFail() - assertThat(result.output).contains("Have you created the publish closure? Missing publishVersion. Missing desc. ") + assertThat(result.output).contains("Have you created the publish closure? Missing desc. ") } } diff --git a/core/src/test/groovy/com/novoda/gradle/release/rule/GradleScriptTemplates.groovy b/core/src/test/groovy/guru/stefma/bintrayrelease/rule/GradleScriptTemplates.groovy similarity index 78% rename from core/src/test/groovy/com/novoda/gradle/release/rule/GradleScriptTemplates.groovy rename to core/src/test/groovy/guru/stefma/bintrayrelease/rule/GradleScriptTemplates.groovy index 424f857..b86f52b 100644 --- a/core/src/test/groovy/com/novoda/gradle/release/rule/GradleScriptTemplates.groovy +++ b/core/src/test/groovy/guru/stefma/bintrayrelease/rule/GradleScriptTemplates.groovy @@ -1,4 +1,4 @@ -package com.novoda.gradle.release.rule +package guru.stefma.bintrayrelease.rule import groovy.transform.PackageScope @@ -9,7 +9,7 @@ class GradleScriptTemplates { return """ plugins { id 'java-library' - id 'com.novoda.bintray-release' + id 'guru.stefma.bintrayrelease' } repositories { @@ -20,11 +20,11 @@ class GradleScriptTemplates { implementation "junit:junit:4.12" } + group = "guru.stefma" + version = "1.0" publish { - userOrg = 'novoda' - groupId = 'com.novoda' + userOrg = 'stefma' artifactId = 'test' - publishVersion = '1.0' desc = 'description' } """ @@ -44,15 +44,14 @@ class GradleScriptTemplates { } plugins { - id 'com.novoda.bintray-release' apply false + id 'guru.stefma.bintrayrelease' apply false } apply plugin: "com.android.library" - apply plugin: "com.novoda.bintray-release" + apply plugin: "guru.stefma.bintrayrelease" android { compileSdkVersion 26 - buildToolsVersion "26.0.2" defaultConfig { minSdkVersion 16 @@ -67,17 +66,18 @@ class GradleScriptTemplates { repositories { jcenter() + google() } dependencies { implementation "junit:junit:4.12" } + group = "guru.stefma" + version = "1.0" publish { - userOrg = 'novoda' - groupId = 'com.novoda' + userOrg = 'stefma' artifactId = 'test' - publishVersion = '1.0' desc = 'description' } """ diff --git a/core/src/test/groovy/com/novoda/gradle/release/rule/TestProjectRule.groovy b/core/src/test/groovy/guru/stefma/bintrayrelease/rule/TestProjectRule.groovy similarity index 95% rename from core/src/test/groovy/com/novoda/gradle/release/rule/TestProjectRule.groovy rename to core/src/test/groovy/guru/stefma/bintrayrelease/rule/TestProjectRule.groovy index 0814c1f..418aff8 100644 --- a/core/src/test/groovy/com/novoda/gradle/release/rule/TestProjectRule.groovy +++ b/core/src/test/groovy/guru/stefma/bintrayrelease/rule/TestProjectRule.groovy @@ -1,4 +1,4 @@ -package com.novoda.gradle.release.rule +package guru.stefma.bintrayrelease.rule import org.junit.rules.TemporaryFolder import org.junit.rules.TestRule @@ -65,7 +65,7 @@ class TestProjectRule implements TestRule { if (project == Project.ANDROID) { new File(tempFolder.root, "/src/main/AndroidManifest.xml").with { getParentFile().mkdirs() - text = "" + text = "" } } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 590f0e8..bb5158d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip diff --git a/samples/android/build.gradle b/samples/android/build.gradle index d361947..5601f2e 100644 --- a/samples/android/build.gradle +++ b/samples/android/build.gradle @@ -9,7 +9,7 @@ buildscript { } apply plugin: 'com.android.library' -apply plugin: com.novoda.gradle.release.ReleasePlugin +apply plugin: guru.stefma.bintrayrelease.ReleasePlugin android { compileSdkVersion 27 @@ -18,11 +18,12 @@ android { targetSdkVersion 27 versionCode 1 versionName "1.0.0" - archivesBaseName = "$archivesBaseName-$versionName" + //archivesBaseName = "$archivesBaseName-$versionName" // This is not working } } repositories { + jcenter() google() } @@ -30,11 +31,11 @@ dependencies { implementation "com.android.support:appcompat-v7:27.0.2" } +group = "guru.stefma" +version = "0.0.1" publish { - userOrg = 'novoda' - groupId = 'com.novoda' + userOrg = 'stefma' artifactId = 'bintray-release.android.sample' - publishVersion = '0.0.1' desc = 'Just a simple android lib sample' - website = 'https://github.com/novoda/bintray-release' + website = 'https://github.com/stefma/bintray-release' } \ No newline at end of file diff --git a/samples/android/src/main/AndroidManifest.xml b/samples/android/src/main/AndroidManifest.xml index 2e7b15f..b045b7b 100644 --- a/samples/android/src/main/AndroidManifest.xml +++ b/samples/android/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/samples/android/src/main/java/com/novoda/gradle/release/sample/android/AndroidSample.java b/samples/android/src/main/java/guru/stefma/bintrayrelease/sample/android/AndroidSample.java similarity index 72% rename from samples/android/src/main/java/com/novoda/gradle/release/sample/android/AndroidSample.java rename to samples/android/src/main/java/guru/stefma/bintrayrelease/sample/android/AndroidSample.java index f6163d7..0b059b3 100644 --- a/samples/android/src/main/java/com/novoda/gradle/release/sample/android/AndroidSample.java +++ b/samples/android/src/main/java/guru/stefma/bintrayrelease/sample/android/AndroidSample.java @@ -1,4 +1,4 @@ -package com.novoda.gradle.release.sample.android; +package guru.stefma.bintrayrelease.sample.android; public class AndroidSample { diff --git a/samples/buildSrc/build.gradle b/samples/buildSrc/build.gradle index e7adbce..8dd836e 100644 --- a/samples/buildSrc/build.gradle +++ b/samples/buildSrc/build.gradle @@ -4,12 +4,14 @@ plugins { repositories { jcenter() + google() } // We have to make sure that we are using the same dependencies as in our 'core' project dependencies { compile gradleApi() compile 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' + compile 'guru.stefma.androidartifacts:androidartifacts:1.0.0' } sourceSets { diff --git a/samples/gradle/wrapper/gradle-wrapper.jar b/samples/gradle/wrapper/gradle-wrapper.jar index 99340b4..758de96 100644 Binary files a/samples/gradle/wrapper/gradle-wrapper.jar and b/samples/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/gradle/wrapper/gradle-wrapper.properties b/samples/gradle/wrapper/gradle-wrapper.properties index 92165ee..debd024 100644 --- a/samples/gradle/wrapper/gradle-wrapper.properties +++ b/samples/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-bin.zip diff --git a/samples/jvm/build.gradle b/samples/jvm/build.gradle index 0e3175e..f74f11d 100644 --- a/samples/jvm/build.gradle +++ b/samples/jvm/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'java-library' -apply plugin: com.novoda.gradle.release.ReleasePlugin +apply plugin: guru.stefma.bintrayrelease.ReleasePlugin repositories { jcenter() @@ -9,11 +9,11 @@ dependencies { implementation "junit:junit:4.12" } +group = "guru.stefma" +version = "0.0.1" publish { - userOrg = 'novoda' - groupId = 'com.novoda' + userOrg = 'stefma' artifactId = 'bintray-release.jvm.sample' - publishVersion = '0.0.1' desc = 'Just a simple java lib sample' - website = 'https://github.com/novoda/bintray-release' + website = 'https://github.com/stefma/bintray-release' } diff --git a/samples/jvm/src/main/java/com/novoda/gradle/release/sample/jvm/JVMSample.java b/samples/jvm/src/main/java/guru/stefma/bintrayrelease/sample/jvm/JVMSample.java similarity index 72% rename from samples/jvm/src/main/java/com/novoda/gradle/release/sample/jvm/JVMSample.java rename to samples/jvm/src/main/java/guru/stefma/bintrayrelease/sample/jvm/JVMSample.java index eafa805..bf66a55 100644 --- a/samples/jvm/src/main/java/com/novoda/gradle/release/sample/jvm/JVMSample.java +++ b/samples/jvm/src/main/java/guru/stefma/bintrayrelease/sample/jvm/JVMSample.java @@ -1,4 +1,4 @@ -package com.novoda.gradle.release.sample.jvm; +package guru.stefma.bintrayrelease.sample.jvm; public class JVMSample { diff --git a/settings.gradle b/settings.gradle index 89a3a03..f414167 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,11 +2,16 @@ pluginManagement { repositories { // TODO: Update later to gradlePluginPortal() if gradle updated maven { url 'https://plugins.gradle.org/m2/' } + mavenLocal() + google() } resolutionStrategy { eachPlugin { - if (requested.id.id == "com.novoda.bintray-release") { - useModule("com.novoda:bintray-release:${requested.version}") + if (requested.id.id == "guru.stefma.bintrayrelease") { + useModule("guru.stefma.bintrayrelease:bintrayrelease:${requested.version}") + } + if(requested.id.id.startsWith("com.android.")) { + useModule("com.android.tools.build:gradle:$requested.id.version") } } }