From ce61f177dcbb286121aa467b0fd445f6a1f0688d Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 30 Mar 2023 11:54:15 +0800 Subject: [PATCH] Adjust build gradle --- V2rayNG/app/build.gradle | 21 ++++------- .../kotlin/com/v2ray/ang/ui/MainActivity.kt | 1 - V2rayNG/build.gradle | 35 +++---------------- V2rayNG/gradle.properties | 20 +++-------- V2rayNG/settings.gradle | 16 +++++++++ 5 files changed, 32 insertions(+), 61 deletions(-) diff --git a/V2rayNG/app/build.gradle b/V2rayNG/app/build.gradle index 72f3ea57..f80927c6 100644 --- a/V2rayNG/app/build.gradle +++ b/V2rayNG/app/build.gradle @@ -1,5 +1,7 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} Properties props = new Properties() props.load(new FileInputStream(new File('local.properties'))) @@ -18,7 +20,7 @@ android { minSdkVersion 21 targetSdkVersion Integer.parseInt("$targetSdkVer") multiDexEnabled true - versionCode 506 + versionCode 507 versionName "1.8.1" } @@ -123,7 +125,7 @@ dependencies { implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1' //kotlin - implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" + implementation "org.jetbrains.kotlin:kotlin-reflect:1.7.20" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4" @@ -139,13 +141,4 @@ dependencies { implementation 'com.blacksquircle.ui:editorkit:2.1.1' implementation 'com.blacksquircle.ui:language-base:2.1.1' implementation 'com.blacksquircle.ui:language-json:2.1.1' -} - -//buildscript { -// repositories { -// google() -// mavenCentral() -// maven { url 'https://maven.google.com' } -// maven { url 'https://jitpack.io' } -// } -//} +} \ No newline at end of file diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt index 0a978670..0286c1d7 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainActivity.kt @@ -633,7 +633,6 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList } else { //super.onBackPressed() onBackPressedDispatcher.onBackPressed() - } } diff --git a/V2rayNG/build.gradle b/V2rayNG/build.gradle index 4a1d7cc9..25369742 100644 --- a/V2rayNG/build.gradle +++ b/V2rayNG/build.gradle @@ -1,31 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - maven { url 'https://maven.google.com' } - maven { url 'https://jitpack.io' } - } - dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - mavenCentral() - maven { url 'https://maven.google.com' } - maven { url 'https://jitpack.io' } - jcenter() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} +plugins { + id 'com.android.application' version '7.3.1' apply false + id 'com.android.library' version '7.3.1' apply false + id 'org.jetbrains.kotlin.android' version '1.7.20' apply false +} \ No newline at end of file diff --git a/V2rayNG/gradle.properties b/V2rayNG/gradle.properties index 02049d84..2fbe9156 100644 --- a/V2rayNG/gradle.properties +++ b/V2rayNG/gradle.properties @@ -1,22 +1,10 @@ -## Project-wide Gradle settings. -# -# 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. -# Default value: -Xmx1024m -XX:MaxPermSize=256m - org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -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 -#Fri Jun 02 14:08:42 CST 2017 -kotlinVersion=1.7.20 + buildToolsVer=33.0.2 compileSdkVer=33 targetSdkVer=33 kotlin.incremental=true android.useAndroidX=true android.enableJetifier=true +kotlin.code.style=official +android.nonTransitiveRClass=true +org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 diff --git a/V2rayNG/settings.gradle b/V2rayNG/settings.gradle index e7b4def4..2b0e1603 100644 --- a/V2rayNG/settings.gradle +++ b/V2rayNG/settings.gradle @@ -1 +1,17 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + jcenter() + } +} +rootProject.name = "V2rayNG" include ':app'