Skip to content

Commit

Permalink
Remove Maven Publish and updated libraries
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Chagas <[email protected]>
  • Loading branch information
rtchagas committed Apr 1, 2020
1 parent cb5d129 commit dab2a87
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 53 deletions.
25 changes: 18 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {

compileSdkVersion 29
buildToolsVersion "29.0.2"

defaultConfig {
applicationId "com.cuberto.liquidswipetest"
minSdkVersion 21
Expand All @@ -15,22 +16,32 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(':liquid-swipe')
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:3.6.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Nov 15 16:50:20 MSK 2019
#Wed Apr 01 15:23:42 BRT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
49 changes: 11 additions & 38 deletions liquid-swipe/build.gradle
Original file line number Diff line number Diff line change
@@ -1,45 +1,10 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'maven-publish'

def githubProperties = new Properties()
githubProperties.load(new FileInputStream(rootProject.file("github.properties")))

def getVersionName = { ->
return "1.0.0"
}

def getArtificatId = { ->
return "liquid-swipe"
}

publishing {
publications {
bar(MavenPublication) {
groupId 'com.cuberto'
artifactId getArtificatId()
version getVersionName()
artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar")
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Cuberto/liquid-swipe-android")
credentials {
username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
}
}
}
}

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"

compileSdkVersion 29

defaultConfig {
minSdkVersion 21
Expand All @@ -58,14 +23,22 @@ android {
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
testImplementation 'junit:junit:4.12'
implementation 'androidx.core:core-ktx:1.2.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LiquidPager : ViewPager, ViewTreeObserver.OnDrawListener, ViewI {
})
}

public fun setButtonDrawable(@DrawableRes drawableId: Int) {
fun setButtonDrawable(@DrawableRes drawableId: Int) {
buttonDrawableId = drawableId
rightEdgeController?.setButtonDrawable(resources.getDrawable(buttonDrawableId, null))
}
Expand All @@ -60,10 +60,10 @@ class LiquidPager : ViewPager, ViewTreeObserver.OnDrawListener, ViewI {
}

override fun getBitmap(direction: Int): Bitmap? {
if (direction == LEFT) {
return getBitmapAt(currentItem - 1)
return if (direction == LEFT) {
getBitmapAt(currentItem - 1)
} else {
return getBitmapAt(currentItem + 1)
getBitmapAt(currentItem + 1)
}
}

Expand Down Expand Up @@ -130,7 +130,7 @@ class LiquidPager : ViewPager, ViewTreeObserver.OnDrawListener, ViewI {
}

override fun onDraw() {
if (leftEdgeController?.hasBitmap() ?: false || rightEdgeController?.hasBitmap() ?: false) {
if (leftEdgeController?.hasBitmap() == true || rightEdgeController?.hasBitmap() == true) {
return
} else {
leftEdgeController?.onPageChanged(currentItem)
Expand Down

0 comments on commit dab2a87

Please sign in to comment.