Skip to content

Commit

Permalink
Fixes to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazer committed May 26, 2017
1 parent 7b35cb1 commit 7565556
Show file tree
Hide file tree
Showing 21 changed files with 124 additions and 111 deletions.
1 change: 0 additions & 1 deletion .idea/runConfigurations/Publish_All.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/runConfigurations/Publish__Core_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/runConfigurations/Publish__GSON_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/runConfigurations/Publish__MVP_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/runConfigurations/Publish__Migration_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/runConfigurations/Publish__Permissions_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions .idea/runConfigurations/Publish__Rest_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/runConfigurations/Publish__UI_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .idea/runConfigurations/Publish__Validation_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions all/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
dependencies {
compile project(':core')
compile project(':ui')
compile project(':gson')
compile project(':mvp')
compile project(':permissions')
compile project(':validation')
compile project(':migration')
compile project(':sqlite')
compile project(':rest')
api project(':mvp')
api project(':validation')
api project(':migration')
api project(':sqlite')
api project(':rest')
}

apply from: new File("${rootProject.projectDir}/publish.gradle")
15 changes: 10 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ subprojects {
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
// make sure this comes *after* you apply the Android plugin
apply plugin: 'com.getkeepsafe.dexcount'
// apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'org.jetbrains.dokka-android'

apply plugin: 'maven-publish'
Expand All @@ -73,14 +73,19 @@ subprojects {
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
warning 'InvalidPackage'
disable 'UnusedResources'
}
}

dependencies {
testCompile 'junit:junit:4.12'
testCompile "com.winterbe:expekt:0.5.0"
testCompile 'com.nhaarman:mockito-kotlin:1.4.0'
testImplementation 'junit:junit:4.12'
testImplementation "com.winterbe:expekt:0.5.0"
testImplementation 'com.nhaarman:mockito-kotlin:1.4.0'

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
}

Expand Down
11 changes: 7 additions & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
dependencies {
compile 'de.halfbit:tinybus:3.0.2'
compile 'de.halfbit:tinybus-extensions:3.0.2'
compile 'com.android.support:multidex:1.0.1'
api 'de.halfbit:tinybus:3.0.2'
api 'de.halfbit:tinybus-extensions:3.0.2'
api 'com.android.support:multidex:1.0.1'

compile "com.android.support:support-v4:${libraries.supportVersion}"
api "com.android.support:support-v4:${libraries.supportVersion}"
javadocDeps "com.android.support:support-v4:${libraries.supportVersion}"

api "com.android.support:support-annotations:${libraries.supportVersion}"
javadocDeps "com.android.support:support-annotations:${libraries.supportVersion}"
}

apply from: new File("${rootProject.projectDir}/publish.gradle")
2 changes: 1 addition & 1 deletion gson/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
compile "com.google.code.gson:gson:2.8.0"
api "com.google.code.gson:gson:2.8.0"
}

apply from: new File("${rootProject.projectDir}/publish.gradle")
4 changes: 2 additions & 2 deletions migration/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies {
compile "com.android.support:support-v4:${libraries.supportVersion}"
compile 'com.j256.ormlite:ormlite-android:5.0'
api "com.android.support:support-v4:${libraries.supportVersion}"
api 'com.j256.ormlite:ormlite-android:5.0'
}

apply from: new File("${rootProject.projectDir}/publish.gradle")
5 changes: 2 additions & 3 deletions mvp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
apply plugin: 'kotlin-android-extensions'

dependencies {
compile project(':core')
compile project(':ui')
api project(':ui')

compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}

apply from: new File("${rootProject.projectDir}/publish.gradle")
8 changes: 4 additions & 4 deletions permissions/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies {
compile "com.android.support:appcompat-v7:${libraries.supportVersion}"
api "com.android.support:appcompat-v7:${libraries.supportVersion}"
javadocDeps "com.android.support:appcompat-v7:${libraries.supportVersion}"
compile "com.android.support:support-v13:${libraries.supportVersion}"
api "com.android.support:support-v13:${libraries.supportVersion}"
javadocDeps "com.android.support:support-v13:${libraries.supportVersion}"
compile "com.android.support:support-v4:${libraries.supportVersion}"
api "com.android.support:support-v4:${libraries.supportVersion}"
javadocDeps "com.android.support:support-v4:${libraries.supportVersion}"

compile('com.afollestad:assent:0.2.5') {
api('com.afollestad:assent:0.2.5') {
transitive = false
}
}
Expand Down
45 changes: 31 additions & 14 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import groovy.xml.QName

def VERSION_NAME = rootProject.ext.VERSION_NAME
def GROUP = rootProject.ext.GROUP
Expand Down Expand Up @@ -25,6 +26,25 @@ artifacts {
archives javadocJar
}

def configureDependencies(Dependency dep, Node dependenciesNode) {
if (dep.group != null && dep.name != null) {
def depGroup = dep.group
def depVersion = dep.version

if (depGroup.equalsIgnoreCase(rootProject.name)) {
depGroup = GROUP
depVersion = VERSION_NAME
}

println "Appending to POM -> $depGroup:${dep.name}:$depVersion"

def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', depGroup)
dependencyNode.appendNode('artifactId', dep.name)
dependencyNode.appendNode('version', depVersion)
}
}

afterEvaluate {
publishing.repositories {
mavenLocal()
Expand All @@ -42,23 +62,20 @@ afterEvaluate {
"${POM_ARTIFACT_ID}"(MavenPublication) {
//The publication doesn't know about our dependencies, so we have to manually add them to the pom
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
logging.captureStandardOutput LogLevel.INFO
println "Configuring POM file"
Node dependenciesNode = asNode().appendNode('dependencies')

//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.compile.allDependencies.each {
if (it.group != null && it.name != null) {
def depGroup = it.group
def depVersion = it.version
if (depGroup.equalsIgnoreCase(rootProject.name)) {
depGroup = GROUP
depVersion = VERSION_NAME
}
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', depGroup)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', depVersion)
}
Set<Dependency> dependencySet = new LinkedHashSet<>()
dependencySet += configurations.api.allDependencies
dependencySet += configurations.implementation.allDependencies
dependencySet += configurations.compile.allDependencies

dependencySet.each {
configureDependencies(it, dependenciesNode)
}
println "Done configuring POM file"
}

artifactId = POM_ARTIFACT_ID
Expand Down
15 changes: 6 additions & 9 deletions rest/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
android.lintOptions {
warning 'InvalidPackage'
}

dependencies {
compile project(':core')
compile project(':gson')
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
api project(':gson')
api project(':core')

api 'com.squareup.retrofit2:retrofit:2.2.0'
api 'com.squareup.retrofit2:converter-gson:2.2.0'

compile 'com.github.mrmike:ok2curl:0.3.1'
api 'com.github.mrmike:ok2curl:0.3.1'
}

apply from: new File("${rootProject.projectDir}/publish.gradle")
10 changes: 5 additions & 5 deletions sqlite/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies {
compile "org.jetbrains.anko:anko-sdk23:${libraries.ankoVersion}"
compile "org.jetbrains.anko:anko-support-v4:${libraries.ankoVersion}"
compile "org.jetbrains.anko:anko-appcompat-v7:${libraries.ankoVersion}"
api "org.jetbrains.anko:anko-sdk23:${libraries.ankoVersion}"
api "org.jetbrains.anko:anko-support-v4:${libraries.ankoVersion}"
api "org.jetbrains.anko:anko-appcompat-v7:${libraries.ankoVersion}"

// Core library
compile 'com.nivabit.kuery:core:0.3'
api 'com.nivabit.kuery:core:0.3'
// SQLite dialect
compile 'com.nivabit.kuery:sqlite:0.3'
api 'com.nivabit.kuery:sqlite:0.3'
}

apply from: new File("${rootProject.projectDir}/publish.gradle")
16 changes: 7 additions & 9 deletions ui/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
dependencies {
compile project(':core')
compile project(':permissions')
api project(':core')
api project(':permissions')

compile "com.android.support:percent:${libraries.supportVersion}"
compile "com.android.support:support-annotations:${libraries.supportVersion}"
javadocDeps "com.android.support:support-annotations:${libraries.supportVersion}"
api "com.android.support:percent:${libraries.supportVersion}"

compile "org.jetbrains.anko:anko-sdk23:${libraries.ankoVersion}"
compile "org.jetbrains.anko:anko-support-v4:${libraries.ankoVersion}"
compile "org.jetbrains.anko:anko-appcompat-v7:${libraries.ankoVersion}"
api "org.jetbrains.anko:anko-sdk23:${libraries.ankoVersion}"
api "org.jetbrains.anko:anko-support-v4:${libraries.ankoVersion}"
api "org.jetbrains.anko:anko-appcompat-v7:${libraries.ankoVersion}"

compile 'com.github.bumptech.glide:glide:3.8.0'
api 'com.github.bumptech.glide:glide:3.8.0'
}

apply from: new File("${rootProject.projectDir}/publish.gradle")
Loading

0 comments on commit 7565556

Please sign in to comment.