From 0959c56611a7746528096502b8720769b236520d Mon Sep 17 00:00:00 2001 From: Villena Guillaume Date: Sat, 16 Jan 2021 23:15:26 +0100 Subject: [PATCH] Updated gradle configuration --- app/build.gradle | 2 +- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +- phoneinputview/build.gradle | 81 ++++++++++++------------ 4 files changed, 44 insertions(+), 45 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4e92a78..c512d27 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,7 +25,7 @@ dependencies { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'androidx.appcompat:appcompat:1.2.0' - implementation project(":phoneinputview") + implementation project(":phoneinputview") testImplementation 'junit:junit:4.12' } diff --git a/build.gradle b/build.gradle index 90bbce2..28407a6 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:4.0.2' + classpath 'com.android.tools.build:gradle:4.1.1' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ff13135..dd5cf09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Jan 03 18:09:03 CET 2021 +#Tue Jan 12 21:53:17 CET 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip diff --git a/phoneinputview/build.gradle b/phoneinputview/build.gradle index ddfdb8a..1c6e088 100644 --- a/phoneinputview/build.gradle +++ b/phoneinputview/build.gradle @@ -1,7 +1,15 @@ apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'maven-publish' + +repositories { + mavenCentral() + google() + jcenter() + maven { url "https://jitpack.io" } +} group = 'com.github.willena' +version = '1.3.1-rc2' android { compileSdkVersion 29 @@ -10,53 +18,44 @@ android { defaultConfig { minSdkVersion 15 targetSdkVersion 29 - versionCode 13 - versionName "1.3.1-rc1" + versionCode 14 + versionName "1.3.1-rc2" consumerProguardFiles 'proguard-rules.pro' } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } dependencies { - api fileTree(include: ['*.jar'], dir: 'libs') - androidTestCompile('androidx.test.espresso:espresso-core:3.1.0', { - exclude group: 'com.android.support', module: 'support-annotations' - }) + implementation fileTree(include: ['*.jar'], dir: 'libs') + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.12' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.android.material:material:1.2.1' implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.15' - testImplementation 'junit:junit:4.12' -} - - -// build a jar with source files -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' } -task javadoc(type: Javadoc) { - failOnError false - source = android.sourceSets.main.java.sourceFiles - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - classpath += configurations.compile -} - -// build a jar with javadoc -task javadocJar(type: Jar, dependsOn: javadoc) { - from javadoc.destinationDir - classifier = 'javadoc' -} - -artifacts { - archives sourcesJar - archives javadocJar -} - -// uncomment to build a jar file in addition to the default aar file -//android.libraryVariants.all { variant -> -// def name = variant.buildType.name -// def task = project.tasks.create "jar${name.capitalize()}", Jar -// task.dependsOn variant.javaCompile -// task.from variant.javaCompile.destinationDir -// artifacts.add('archives', task); -//} \ No newline at end of file +afterEvaluate { + publishing { + publications { + // Creates a Maven publication called "release". + release(MavenPublication) { + from components.release + groupId = 'com.github.willena' + artifactId = 'phonenumber-widget' + version = '1.3.1-rc2' + } + } + } +} \ No newline at end of file