Skip to content

Commit

Permalink
Local library setup
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsinghmutualmobile committed Apr 13, 2022
1 parent 35e929c commit 8f3f728
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 2 deletions.
4 changes: 3 additions & 1 deletion barricade-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ plugins {
java {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
}

apply from: '../publish-helper.gradle'
4 changes: 3 additions & 1 deletion barricade-compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ java {
dependencies {
implementation(project(":barricade-annotations"))
implementation("com.google.devtools.ksp:symbol-processing-api:1.6.10-1.0.4")
}
}

apply from: '../publish-helper.gradle'
5 changes: 5 additions & 0 deletions barricade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@ dependencies {
implementation("com.squareup.okhttp3:logging-interceptor")

implementation "com.google.accompanist:accompanist-systemuicontroller:0.24.3-alpha"
}

apply from: '../publish-helper.gradle'
tasks.withType(Javadoc).all {
enabled = false
}
91 changes: 91 additions & 0 deletions publish-helper.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
apply plugin: 'maven-publish'

task androidJavadoc(type: Javadoc) {
if (plugins.hasPlugin('android-library')) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompileProvider.get().classpath
}
}
}
else {
source = sourceSets.main.allJava
classpath += configurations.runtimeClasspath
classpath += configurations.compileClasspath
}
exclude '**/R.html', '**/R.*.html', '**/index.html'
options.encoding 'utf-8'
options {
addStringOption 'docencoding', 'utf-8'
addStringOption 'charset', 'utf-8'
links 'https://docs.oracle.com/javase/7/docs/api/'
links 'https://d.android.com/reference'
links 'https://developer.android.com/reference/androidx/'
}
}

task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
archiveClassifier.set('javadoc')
from androidJavadoc.destinationDir
preserveFileTimestamps = false
reproducibleFileOrder = true
}

task javaSourcesJar(type: Jar) {
archiveClassifier.set('sources')
if (plugins.hasPlugin('android-library')) {
from android.sourceSets.main.java.srcDirs
}
else {
from sourceSets.main.allSource
}
preserveFileTimestamps = false
reproducibleFileOrder = true
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
if (plugins.hasPlugin('android-library')) {
from components.release
}
else if (plugins.hasPlugin('java')) {
from components.java
jar.preserveFileTimestamps = false
jar.reproducibleFileOrder = true
}

artifact androidJavadocJar
artifact javaSourcesJar

groupId 'com.mutualmobile.barricade2'
version '0.0.1'
pom {
name = artifactId
description = 'Runtime configurable local server for Android apps.'
url = 'https://github.com/mutualmobile/Barricade2'
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = ''
url = ''
}
developers {
developer {
id = ''
name = 'Mutual Mobile'
email = ''
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pluginManagement {
id 'org.jetbrains.kotlin.android' version '1.5.21'
}
repositories {
mavenLocal()
gradlePluginPortal()
google()
mavenCentral()
Expand Down

0 comments on commit 8f3f728

Please sign in to comment.