Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zsmb13 committed Jul 22, 2018
2 parents 37dabce + 1faea43 commit 0bed06d
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 18 deletions.
32 changes: 26 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
image: registry.gitlab.com/hardysim/android-ci:latest

cache:
paths:
- .gradle/wrapper
- .gradle/caches
- .android/build-cache/

stages:
- debug
- build
- release

before_script:
Expand All @@ -10,20 +16,34 @@ before_script:
- chmod +x ./gradlew

debug build:
stage: debug
stage: build
tags:
- docker
script:
- ./gradlew assembleDebug
except:
- master

library release:
stage: release
library release build:
stage: build
tags:
- docker
script:
- ./gradlew generateRelease
- ./gradlew clean library:assembleRelease androidSourcesJar androidJavadocsJar
artifacts:
paths:
- library/build/release-*
- library/build*
only:
- master

library upload to Bintray:
stage: release
tags:
- docker
script:
- ./gradlew generatePomFileForReleasePublication bintrayUpload
dependencies:
- library release build
only:
- master
when: manual
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can find the sample app [in the Play Store](https://play.google.com/store/ap
The library is hosted on jcenter. To use it, add the following to your module level `build.gradle` file's dependencies:

```gradle
implementation 'co.zsmb:materialdrawer-kt:1.3.5'
implementation 'co.zsmb:materialdrawer-kt:1.3.6'
// required support libraries
implementation "com.android.support:appcompat-v7:${versions.supportLib}"
Expand Down
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.50'
ext.kotlin_version = '1.2.51'
ext.support_lib_version = '27.1.1'
repositories {
jcenter()
Expand All @@ -11,8 +9,8 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

Expand Down
11 changes: 7 additions & 4 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

apply from: '../testformatter.gradle'
apply plugin: 'maven-publish'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

ext {
PUBLISH_GROUP_ID = 'co.zsmb'
PUBLISH_ARTIFACT_ID = 'materialdrawer-kt'
PUBLISH_VERSION = '1.3.5'
PUBLISH_VERSION = '1.3.6'
}

android {
Expand All @@ -25,7 +27,7 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

api('com.mikepenz:materialdrawer:6.0.8@aar') {
api('com.mikepenz:materialdrawer:6.0.9@aar') {
transitive = true
}
implementation "com.android.support:appcompat-v7:$support_lib_version"
Expand All @@ -34,4 +36,5 @@ dependencies {
implementation "com.android.support:design:$support_lib_version"
}

apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
apply from: '../testformatter.gradle'
apply from: '../publish.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public class ProfileDrawerItemKt : AbstractDrawerItemKt<ProfileDrawerItem>(Profi
*
* Non readable property. Wraps the [ProfileDrawerItem.withName] method.
*/
public var name: String
public var name: CharSequence
@Deprecated(level = DeprecationLevel.ERROR, message = "Non readable property.")
get() = nonReadable()
set(value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public class ProfileSettingDrawerItemKt : AbstractDrawerItemKt<ProfileSettingDra
*
* Non readable property. Wraps the [ProfileSettingDrawerItem.withName] method.
*/
public var name: String
public var name: CharSequence
@Deprecated(level = DeprecationLevel.ERROR, message = "Non readable property.")
get() = nonReadable()
set(value) {
Expand Down
71 changes: 71 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
task androidJavadocs(type: Javadoc) {
failOnError = false
source = android.sourceSets.main.java.source
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.source
}

bintray {
dryRun = false
publish = true
override = true

Properties properties = new Properties()

def localPropsFile = project.rootProject.file('local.properties')
if (localPropsFile.exists()) {
properties.load(localPropsFile.newDataInputStream())
}

user = properties.getProperty('bintrayUser') ?: System.getenv('BINTRAY_USER')
key = properties.getProperty('bintrayKey') ?: System.getenv('BINTRAY_API_KEY')

publications('release')

pkg {
repo = "MaterialDrawerKt"
name = "MaterialDrawerKt"
vcsUrl = "https://gitlab.com/zsmb/MaterialDrawerKt"

publicDownloadNumbers = true
licenses = ["Apache-2.0"]
version {
name = PUBLISH_VERSION
vcsTag = PUBLISH_VERSION
released = new Date()
}
}

publishing {
publications {
release(MavenPublication) {
groupId PUBLISH_GROUP_ID
artifactId PUBLISH_ARTIFACT_ID
version PUBLISH_VERSION
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
artifact androidSourcesJar
artifact androidJavadocsJar

pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')

project.configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}

0 comments on commit 0bed06d

Please sign in to comment.