diff --git a/app/build.gradle b/app/build.gradle index ed8fde5..4a10ff1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,8 +26,7 @@ dependencies { implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'co.trikita:anvil-sdk15:0.5.2' - implementation 'co.trikita:anvil-design:0.5.2' + implementation 'co.trikita:anvil-sdk21:0.5.21' implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' diff --git a/build.gradle b/build.gradle index 3b1dc26..c60deea 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +ext.groupName = GROUP +ext.applicationName = APPLICATION + buildscript { ext.kotlin_version = '1.3.50' repositories { diff --git a/core/build.gradle b/core/build.gradle index c44ba6a..1bcedff 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'maven-publish' group = "com.github.oxeanbits" @@ -23,12 +24,53 @@ android { } } +task javadoc(type: Javadoc) { + excludes = ['**/*.kt'] // < ---- Exclude all kotlin files from javadoc file. + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + archiveClassifier.set('javadoc') + from javadoc.destinationDir +} + +task sourcesJar(type: Jar) { + archiveClassifier.set('sources') + from android.sourceSets.main.java.srcDirs +} + +project.afterEvaluate { + publishing { + publications { + forecastChart(MavenPublication) { + group groupName + version android.defaultConfig.versionName + artifactId applicationName + artifact bundleRelease + artifact sourcesJar + artifact javadocJar + + pom.withXml { + def dependenciesNode = asNode().appendNode('dependencies') + configurations.compile.allDependencies.each { dependency -> + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', dependency.group) + dependencyNode.appendNode('artifactId', dependency.name) + dependencyNode.appendNode('version', dependency.version) + } + } + } + } + } +} + + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'co.trikita:anvil-sdk15:0.5.2' - implementation 'co.trikita:anvil-design:0.5.2' + implementation 'co.trikita:anvil-sdk21:0.5.21' implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' diff --git a/gradle.properties b/gradle.properties index dbe0688..0d8276a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,3 +25,6 @@ android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official + +GROUP = com.oxeanbits +APPLICATION = forecastchart