Skip to content

Commit

Permalink
修改Kotlin及AGP版本
Browse files Browse the repository at this point in the history
  • Loading branch information
hpuhsp committed May 6, 2023
1 parent 8c4d8ed commit 6c0bad6
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 47 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
id 'kotlin-parcelize'
}
android {
compileSdk 33
compileSdkVersion 30

defaultConfig {
applicationId "com.hsp.scanner"
minSdk 21
targetSdk 33
minSdkVersion 21
targetSdkVersion 30

versionCode 21
versionName "1.7.1"
Expand Down
49 changes: 45 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
plugins {
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.10"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
}
// 解决上传乱码问题
tasks.withType(Javadoc) {
options {
encoding "UTF-8"
charSet "UTF-8"
links "http://docs.oracle.com/javase/7/docs/api"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
configurations.all {
resolutionStrategy {
eachDependency { details ->
// Force all of the primary libraries to use the same version.
if (details.requested.name == 'appcompat'
&& details.requested.name == 'annotation'
&& details.requested.name == 'recyclerview') {
details.useVersion rootProject.ext.version["androidXSdkVersion"]
}
}
}
}
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 @@
#Thu Mar 18 10:20:07 GMT+08:00 2021
#Fri Dec 25 09:55:25 GMT+08:00 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
24 changes: 6 additions & 18 deletions scanner/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
id 'kotlin-parcelize'
id 'maven-publish'
}
task generateSourcesJar(type: Jar) {
Expand All @@ -11,12 +11,12 @@ task generateSourcesJar(type: Jar) {
}

android {
compileSdk 33
compileSdkVersion 30
ndkVersion '22.1.7171670' // Jitpack构建ndk版本,发布新版本时打开

defaultConfig {
minSdk 21
targetSdk 33
minSdkVersion 21
targetSdkVersion 30

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down Expand Up @@ -73,16 +73,4 @@ publishing {
}
}
}
}


//apply from: '../bintray.gradle'
//apply from: '../nexus_upload.gradle'

// 上传Maven 中央仓库
//ext {
// PUBLISH_GROUP_ID = 'io.github.hpuhsp'
// PUBLISH_ARTIFACT_ID = 'qr-scanner'
// PUBLISH_VERSION = '1.0.0'
//}
//apply from: '../publish_mavencentral.gradle'
}
19 changes: 1 addition & 18 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
}
}

rootProject.name = "QRScanner"
include ':scanner'
include ':app'
rootProject.name = "QRScanner"

0 comments on commit 6c0bad6

Please sign in to comment.