Skip to content

Commit

Permalink
Modernize project layout
Browse files Browse the repository at this point in the history
  • Loading branch information
apsun committed Jun 26, 2018
1 parent 1ead20d commit 6f62246
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 95 deletions.
102 changes: 8 additions & 94 deletions build.gradle
@@ -1,105 +1,19 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:2.2.3"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
classpath "com.github.dcendents:android-maven-gradle-plugin:1.5"
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

apply plugin: "com.android.library"
apply plugin: "com.jfrog.bintray"
apply plugin: "com.github.dcendents.android-maven"

group = "com.crossbowffs.remotepreferences"
version = "0.6"

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 1
targetSdkVersion 25
versionCode 6
versionName "0.6"
}

sourceSets {
main {
manifest.srcFile "AndroidManifest.xml"
java.srcDir "src"
}
}
}

task sourcesJar(type: Jar) {
classifier = "sources"
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
}

bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_API_KEY")
pkg {
repo = "maven"
name = "remotepreferences"
licenses = ["MIT"]
vcsUrl = "https://github.com/apsun/RemotePreferences.git"
configurations = ["archives"]
}
}

install {
repositories.mavenInstaller {
pom.project {
name "remotepreferences"
description "A drop-in solution for inter-app access to SharedPreferences on Android."
url "https://github.com/apsun/RemotePreferences"
inceptionYear "2016"

packaging "aar"
groupId "com.crossbowffs.remotepreferences"
artifactId "remotepreferences"

licenses {
license {
name "MIT"
url "https://opensource.org/licenses/MIT"
}
}

scm {
connection "https://github.com/apsun/RemotePreferences.git"
url "https://github.com/apsun/RemotePreferences"
}

developers {
developer {
id "crossbowffs"
name "Andrew Sun"
email "0xandrewsun@gmail.com"
}
}
}
allprojects {
repositories {
google()
jcenter()
}
}
67 changes: 67 additions & 0 deletions library/build.gradle
@@ -0,0 +1,67 @@
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

ext {
packageName = 'com.crossbowffs.remotepreferences'
libraryName = 'remotepreferences'
versionCode = 6
versionName = '0.6'
licenses = ['MIT']
vcsUrl = 'https://github.com/apsun/RemotePreferences.git'
}

group = project.packageName
version = project.versionName

android {
compileSdkVersion 27

defaultConfig {
minSdkVersion 1
targetSdkVersion 27
versionCode project.versionCode
versionName project.versionName
}
}

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

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

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

artifacts {
archives javadocJar
archives sourcesJar
}

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
configurations = ['archives']
pkg {
repo = 'maven'
name = project.libraryName
licenses = project.licenses
vcsUrl = project.vcsUrl
}
}

install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'
artifactId project.libraryName
}
}
}
File renamed without changes.
Expand Up @@ -368,7 +368,7 @@ private Uri getPreferenceUri(String prefName, String prefKey) {
return builder.build();
}

private class PrefNameKeyPair {
private static class PrefNameKeyPair {
private final String name;
private final String key;

Expand Down
1 change: 1 addition & 0 deletions settings.gradle
@@ -0,0 +1 @@
include ':library'

0 comments on commit 6f62246

Please sign in to comment.