Skip to content

Commit

Permalink
Merge pull request #1 from StefMa/feature/use_android_artifacts
Browse files Browse the repository at this point in the history
Use android artifacts
  • Loading branch information
StefMa authored Jul 11, 2018
2 parents 0d998ad + ddd3cd6 commit 10ab9d5
Show file tree
Hide file tree
Showing 37 changed files with 321 additions and 479 deletions.
52 changes: 52 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
86 changes: 39 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:<latest-version>'
// 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<PublishExtension> {
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".
11 changes: 0 additions & 11 deletions ci/prBuilder.sh

This file was deleted.

6 changes: 0 additions & 6 deletions core/README.md

This file was deleted.

27 changes: 14 additions & 13 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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"
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 10ab9d5

Please sign in to comment.