Skip to content

Commit

Permalink
Update AGP
Browse files Browse the repository at this point in the history
  • Loading branch information
vvb2060 committed Apr 28, 2022
1 parent 5f1e01e commit c880f75
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 193 deletions.
20 changes: 0 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +0,0 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0-alpha14'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
56 changes: 15 additions & 41 deletions curl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@ plugins {
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
ndkVersion '21.4.7075529'
compileSdkVersion 32
buildToolsVersion "32.0.0"
ndkVersion '23.1.7779620'
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName '7.75.0'
targetSdkVersion 32
versionCode 2
versionName '7.83.0'
externalNativeBuild {
ndkBuild {
arguments "-j${Runtime.runtime.availableProcessors()}"
}
}
}

buildTypes {
release {
minifyEnabled true
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
Expand All @@ -46,38 +40,19 @@ android {
headers "src/main/native/curl/include"
}
}
}

dependencies {
api 'io.github.vvb2060.ndk:boringssl:2.1'
}

afterEvaluate {
android.libraryVariants.collect { variant ->
task("generate${variant.name.capitalize()}SourcesJar", type: Jar) {
from variant.javaCompileProvider.get().source
classifier 'sources'
}
task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) {
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
options.addStringOption "-release", "8"
}
source variant.javaCompileProvider.get().source
classpath += variant.javaCompileProvider.get().classpath
classpath += files(android.getBootClasspath())
options {
failOnError false
encoding 'UTF-8'
}
}
task("generate${variant.name.capitalize()}JavadocJar", type: Jar) {
dependsOn "generate${variant.name.capitalize()}Javadoc"
from tasks.getByName("generate${variant.name.capitalize()}Javadoc").destinationDir
classifier 'javadoc'
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

dependencies {
api 'io.github.vvb2060.ndk:boringssl:3.0'
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand All @@ -86,8 +61,6 @@ publishing {
version android.defaultConfig.versionName
afterEvaluate {
from components.release
artifact generateReleaseJavadocJar
artifact generateReleaseSourcesJar
}
pom {
name = 'curl'
Expand All @@ -102,6 +75,7 @@ publishing {
developers {
developer {
name = 'vvb2060'
url = 'https://github.com/vvb2060'
}
}
scm {
Expand Down
21 changes: 10 additions & 11 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ plugins {
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
ndkVersion '21.4.7075529'
compileSdkVersion 32
buildToolsVersion "32.0.0"
ndkVersion '23.1.7779620'
defaultConfig {
applicationId "io.github.vvb2060.ndk.curl.example"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 32
versionCode 1
versionName "1.0"
externalNativeBuild {
Expand All @@ -21,10 +21,7 @@ android {

buildTypes {
release {
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.debug
proguardFiles 'proguard-rules.pro'
}
}

Expand All @@ -41,12 +38,14 @@ android {
externalNativeBuild {
ndkBuild.path 'src/main/native/Android.mk'
}
}

repositories {
mavenLocal()
packagingOptions {
jniLibs {
useLegacyPackaging false
}
}
}

dependencies {
implementation 'io.github.vvb2060.ndk:curl:7.75.0'
implementation 'io.github.vvb2060.ndk:curl:7.83.0'
}
16 changes: 0 additions & 16 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c880f75

Please sign in to comment.