Skip to content

Commit

Permalink
Merge pull request #8 from triandamai/main
Browse files Browse the repository at this point in the history
feat: use maven publish
  • Loading branch information
triandamai authored Jan 3, 2022
2 parents baff260 + e0aee5b commit 844b60a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 40 deletions.
2 changes: 1 addition & 1 deletion application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ apply from:'../common.gradle'
dependencies {
//todo add dependencies here
implementation project(':singleadapter')
//implementation "com.github.trianapp:singleadapter:v1.0.16"
//implementation "com.github.trianapp:singleadapter:v1.0.19"

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import app.trian.singleadapter.AnimatedItem
import app.trian.singleadapter.SingleAdapter
import app.trian.singleadapter.SingleAdapterAnimation


class MainActivity : AppCompatActivity() {
lateinit var rv:RecyclerView
override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -23,6 +24,7 @@ class MainActivity : AppCompatActivity() {
Toast.makeText(this,item.name,LENGTH_LONG).show()

}

rv.layoutManager = LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)
rv.adapter = adapter

Expand Down
10 changes: 1 addition & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ buildscript {
dependencies {
classpath(Libs.GradlePlugin.androidGradlePlugin)
classpath(Libs.GradlePlugin.kotlinGradlePlugin)
// classpath(Libs.GradlePlugin.mavenGradlePlugin)


}
Expand All @@ -29,19 +28,12 @@ allprojects {
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }


}

}

task clean(type: Delete) {
delete rootProject.buildDir
}
tasks.withType(Test){
testLogging {
exceptionFormat "full"
events "started", "skipped", "passed", "failed"
showStandardStreams true
}
}


34 changes: 17 additions & 17 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ android {
vectorDrawables.useSupportLibrary = true
consumerProguardFiles 'consumer-rules.pro'
}
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true

// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86, armeabi-v7a, and mips.
reset()

// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"

// Specifies that we want to also generate a universal APK that includes all ABIs.
universalApk true
}
}
// splits {
// // Configures multiple APKs based on ABI.
// abi {
// // Enables building multiple APKs per ABI.
// enable true
//
// // By default all ABIs are included, so use reset() and include to specify that we only
// // want APKs for x86, armeabi-v7a, and mips.
// reset()
//
// // Specifies a list of ABIs that Gradle should create APKs for.
// include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
//
// // Specifies that we want to also generate a universal APK that includes all ABIs.
// universalApk true
// }
// }

buildTypes {
release {
Expand Down
4 changes: 3 additions & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ jdk:
- openjdk11
before_install:
- sdk install java 11.0.10-open
- sdk use java 11.0.10-open
- sdk use java 11.0.10-open
install:
- ./gradlew build :lib:publishToMavenLocal
31 changes: 19 additions & 12 deletions singleadapter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,31 @@ plugins {
id 'kotlin-android'
id 'maven-publish'
}

apply from:'../common.gradle'
group = "com.github.trianapp"

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


repositories {
mavenCentral()
google()
jcenter()
maven { url "https://jitpack.io" }
}

dependencies {
//todo add dependencies here
}

afterEvaluate {
publishing{
publications{
release(MavenPublication){
project.afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

groupId = 'app.trian'
artifactId = 'singleadapter'
version = '1.0.19'
artifact androidSourcesJar // optional sources
}
}
}
}
}

0 comments on commit 844b60a

Please sign in to comment.