From 9d466997f700e131aadc418a5ad6bf36adfb6475 Mon Sep 17 00:00:00 2001 From: imkiva Date: Fri, 7 May 2021 18:44:45 +0800 Subject: [PATCH] BUILD: upgrade to Gradle 7.0 - upgrade Kotlin to 1.4.32 - upgrade android gradle plugin to 4.1.3 - remove `versionNameSuffix` - remove `buildToolsVersion` as android gradle plugin already done it - remove unnecessary `targetCompatibility` and `sourceCompatibility` in subprojects - remove proguard - remove NeoTermBridgeExample - remove unused tests - remove bintray upload of NeoTermBridge --- .gitignore | 3 +- NeoLang/build.gradle | 4 - NeoTermBridge/bintray.gradle | 71 - NeoTermBridge/build.gradle | 8 +- NeoTermBridge/proguard-rules.pro | 21 - .../bridge/ExampleInstrumentedTest.java | 26 - NeoTermBridgeExample/.gitignore | 1 - NeoTermBridgeExample/build.gradle | 34 - NeoTermBridgeExample/proguard-rules.pro | 21 - .../example/ExampleInstrumentedTest.java | 26 - .../src/main/AndroidManifest.xml | 21 - .../neoterm/bridge/example/MainActivity.java | 70 - .../drawable-v24/ic_launcher_foreground.xml | 34 - .../res/drawable/ic_launcher_background.xml | 170 - .../src/main/res/layout/activity_main.xml | 28 - .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 2963 -> 0 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 4905 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2060 -> 0 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 2783 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4490 -> 0 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 6895 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 6387 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 10413 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 9128 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 15132 -> 0 bytes .../src/main/res/values/colors.xml | 6 - .../src/main/res/values/strings.xml | 3 - .../src/main/res/values/styles.xml | 8 - .../bridge/example/ExampleUnitTest.java | 17 - Xorg/build.gradle | 4 - Xorg/proguard-rules.pro | 21 - .../io/neoterm/ExampleInstrumentedTest.java | 26 - app/build.gradle | 7 +- app/docs/mapping-30.txt | 40538 ---------------- app/proguard-rules.pro | 99 - app/src/test/java/io/neoterm/CodeGenTest.kt | 27 - .../test/java/io/neoterm/CombinedKeyTest.kt | 22 - .../test/java/io/neoterm/ConfigureFileTest.kt | 72 - .../java/io/neoterm/PackageManagerTest.kt | 37 - .../test/java/io/neoterm/TestInitializer.kt | 12 - build.gradle | 34 +- chrome-tabs/build.gradle | 5 - gradle/wrapper/gradle-wrapper.properties | 2 +- local.properties | 1 - settings.gradle | 2 +- 47 files changed, 9 insertions(+), 41482 deletions(-) delete mode 100644 NeoTermBridge/bintray.gradle delete mode 100644 NeoTermBridge/proguard-rules.pro delete mode 100644 NeoTermBridge/src/androidTest/java/io/neoterm/bridge/ExampleInstrumentedTest.java delete mode 100644 NeoTermBridgeExample/.gitignore delete mode 100644 NeoTermBridgeExample/build.gradle delete mode 100644 NeoTermBridgeExample/proguard-rules.pro delete mode 100644 NeoTermBridgeExample/src/androidTest/java/io/neoterm/bridge/example/ExampleInstrumentedTest.java delete mode 100644 NeoTermBridgeExample/src/main/AndroidManifest.xml delete mode 100644 NeoTermBridgeExample/src/main/java/io/neoterm/bridge/example/MainActivity.java delete mode 100644 NeoTermBridgeExample/src/main/res/drawable-v24/ic_launcher_foreground.xml delete mode 100644 NeoTermBridgeExample/src/main/res/drawable/ic_launcher_background.xml delete mode 100644 NeoTermBridgeExample/src/main/res/layout/activity_main.xml delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-hdpi/ic_launcher_round.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-mdpi/ic_launcher_round.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 NeoTermBridgeExample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png delete mode 100644 NeoTermBridgeExample/src/main/res/values/colors.xml delete mode 100644 NeoTermBridgeExample/src/main/res/values/strings.xml delete mode 100644 NeoTermBridgeExample/src/main/res/values/styles.xml delete mode 100644 NeoTermBridgeExample/src/test/java/io/neoterm/bridge/example/ExampleUnitTest.java delete mode 100644 Xorg/proguard-rules.pro delete mode 100644 Xorg/src/androidTest/java/io/neoterm/ExampleInstrumentedTest.java delete mode 100644 app/docs/mapping-30.txt delete mode 100644 app/proguard-rules.pro delete mode 100644 app/src/test/java/io/neoterm/CodeGenTest.kt delete mode 100644 app/src/test/java/io/neoterm/CombinedKeyTest.kt delete mode 100644 app/src/test/java/io/neoterm/ConfigureFileTest.kt delete mode 100644 app/src/test/java/io/neoterm/PackageManagerTest.kt delete mode 100644 app/src/test/java/io/neoterm/TestInitializer.kt delete mode 100644 local.properties diff --git a/.gitignore b/.gitignore index 1f1d8a2..0902448 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ # generated files bin/ gen/ +.cxx/ # Local configuration file (sdk path, etc) local.properties @@ -27,8 +28,6 @@ proguard/ *.ipr *.iws .idea/ - -*.iml .gradle /local.properties /.idea/workspace.xml diff --git a/NeoLang/build.gradle b/NeoLang/build.gradle index e95d65f..35c13da 100644 --- a/NeoLang/build.gradle +++ b/NeoLang/build.gradle @@ -6,9 +6,6 @@ dependencies { compile rootProject.ext.deps["kotlin-stdlib"] } -sourceCompatibility = "1.7" -targetCompatibility = "1.7" - buildscript { repositories { mavenCentral() @@ -30,7 +27,6 @@ compileTestKotlin { jvmTarget = "1.8" } } - dependencies { testImplementation rootProject.ext.deps["junit"] } diff --git a/NeoTermBridge/bintray.gradle b/NeoTermBridge/bintray.gradle deleted file mode 100644 index ef75194..0000000 --- a/NeoTermBridge/bintray.gradle +++ /dev/null @@ -1,71 +0,0 @@ -apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'com.jfrog.bintray' - -def siteUrl = 'https://github.com/NeoTerm/NeoTerm.git' -def gitUrl = 'https://github.com/NeoTerm/NeoTerm.git' -def libraryGroup = "io.neoterm.bridge" -def libraryRepoName = "neoterm-bridge" -def libraryDesc = "Communicate with NeoTerm in an elegant way." -def libraryVersionCode = 1 -def libraryVersionName = "1.0" -def libraryLicences = ["MIT"] - -group = libraryGroup -version = libraryVersionName + "-" + libraryVersionCode - -install { - repositories.mavenInstaller { - pom { - project { - packaging 'aar' - name libraryDesc - url siteUrl - licenses { - license { - name 'The MIT Software License' - url 'https://mit-license.org/' - } - } - developers { - developer { - id 'imkiva' - name 'imKiva' - email 'libkernelpanic@gmail.com' - } - } - scm { - connection gitUrl - developerConnection gitUrl - url siteUrl - } - } - } - } -} - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts { - archives sourcesJar -} - -Properties properties = new Properties() -properties.load(project.file('../local.properties').newDataInputStream()) -bintray { - user = properties.getProperty("bintray.user") - key = properties.getProperty("bintray.apikey") - configurations = ['archives'] - pkg { - repo = "maven" - name = libraryRepoName - websiteUrl = siteUrl - vcsUrl = gitUrl - dryRun = false - licenses = libraryLicences - publish = true - publicDownloadNumbers = true - } -} diff --git a/NeoTermBridge/build.gradle b/NeoTermBridge/build.gradle index a8edc21..974ede2 100644 --- a/NeoTermBridge/build.gradle +++ b/NeoTermBridge/build.gradle @@ -5,33 +5,27 @@ def libraryVersionName = "1.0" android { compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION - buildToolsVersion '28.0.3' defaultConfig { minSdkVersion rootProject.ext.android.MIN_SDK_VERSION targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION versionCode libraryVersionCode versionName libraryVersionName - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - } buildTypes { release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) testImplementation rootProject.ext.deps["junit"] } - -apply from: 'bintray.gradle' diff --git a/NeoTermBridge/proguard-rules.pro b/NeoTermBridge/proguard-rules.pro deleted file mode 100644 index f1b4245..0000000 --- a/NeoTermBridge/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/NeoTermBridge/src/androidTest/java/io/neoterm/bridge/ExampleInstrumentedTest.java b/NeoTermBridge/src/androidTest/java/io/neoterm/bridge/ExampleInstrumentedTest.java deleted file mode 100644 index 4a2741e..0000000 --- a/NeoTermBridge/src/androidTest/java/io/neoterm/bridge/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.neoterm.bridge; - -import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -/** - * Instrumented test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("io.neoterm.bridge.test", appContext.getPackageName()); - } -} diff --git a/NeoTermBridgeExample/.gitignore b/NeoTermBridgeExample/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/NeoTermBridgeExample/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/NeoTermBridgeExample/build.gradle b/NeoTermBridgeExample/build.gradle deleted file mode 100644 index fa6b705..0000000 --- a/NeoTermBridgeExample/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 28 - - - - defaultConfig { - applicationId "io.neoterm.bridge.example" - minSdkVersion 21 - targetSdkVersion 28 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' - implementation project(':NeoTermBridge') -} diff --git a/NeoTermBridgeExample/proguard-rules.pro b/NeoTermBridgeExample/proguard-rules.pro deleted file mode 100644 index f1b4245..0000000 --- a/NeoTermBridgeExample/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/NeoTermBridgeExample/src/androidTest/java/io/neoterm/bridge/example/ExampleInstrumentedTest.java b/NeoTermBridgeExample/src/androidTest/java/io/neoterm/bridge/example/ExampleInstrumentedTest.java deleted file mode 100644 index 51e42c0..0000000 --- a/NeoTermBridgeExample/src/androidTest/java/io/neoterm/bridge/example/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.neoterm.bridge.example; - -import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -/** - * Instrumented test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("io.neoterm.bridge.example", appContext.getPackageName()); - } -} diff --git a/NeoTermBridgeExample/src/main/AndroidManifest.xml b/NeoTermBridgeExample/src/main/AndroidManifest.xml deleted file mode 100644 index 1a94d0e..0000000 --- a/NeoTermBridgeExample/src/main/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/NeoTermBridgeExample/src/main/java/io/neoterm/bridge/example/MainActivity.java b/NeoTermBridgeExample/src/main/java/io/neoterm/bridge/example/MainActivity.java deleted file mode 100644 index e6356bd..0000000 --- a/NeoTermBridgeExample/src/main/java/io/neoterm/bridge/example/MainActivity.java +++ /dev/null @@ -1,70 +0,0 @@ -package io.neoterm.bridge.example; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.widget.Toast; - -import io.neoterm.bridge.Bridge; -import io.neoterm.bridge.SessionId; - -public class MainActivity extends Activity { - - private static final int REQUEST_CODE_RUN = 1; - private static final int REQUEST_CODE_APPEND = 2; - private static final int REQUEST_CODE_APPEND_SILENTLY = 3; - private static final String COMMAND = "echo \"hello world\""; - - private SessionId lastSessionId; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - } - - public void onRunHelloWorld(View view) { - Intent intent = Bridge.createExecuteIntent(COMMAND); - startActivityForResult(intent, REQUEST_CODE_RUN); - } - - public void onAppendHelloWorld(View view) { - if (lastSessionId == null) { - Toast.makeText(this, "Please run at least once", - Toast.LENGTH_SHORT).show(); - } - - Intent intent = Bridge.createExecuteIntent(lastSessionId, COMMAND); - startActivityForResult(intent, REQUEST_CODE_APPEND); - } - - public void onAppendHelloWorldSilently(View view) { - if (lastSessionId == null) { - Toast.makeText(this, "Please run at least once", - Toast.LENGTH_SHORT).show(); - } - Intent intent = Bridge.createExecuteIntent(lastSessionId, COMMAND, false); - startActivityForResult(intent, REQUEST_CODE_APPEND_SILENTLY); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (resultCode != RESULT_OK) { - Toast.makeText(this, "Failed", Toast.LENGTH_SHORT).show(); - return; - } - - switch (requestCode) { - case REQUEST_CODE_RUN: - lastSessionId = Bridge.parseResult(data); - break; - case REQUEST_CODE_APPEND: - Toast.makeText(this, "appended to " + lastSessionId.toString(), Toast.LENGTH_SHORT).show(); - break; - case REQUEST_CODE_APPEND_SILENTLY: - Toast.makeText(this, "appended silently to " + lastSessionId.toString(), Toast.LENGTH_SHORT).show(); - break; - } - } -} diff --git a/NeoTermBridgeExample/src/main/res/drawable-v24/ic_launcher_foreground.xml b/NeoTermBridgeExample/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 1f6bb29..0000000 --- a/NeoTermBridgeExample/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/NeoTermBridgeExample/src/main/res/drawable/ic_launcher_background.xml b/NeoTermBridgeExample/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 0d025f9..0000000 --- a/NeoTermBridgeExample/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/NeoTermBridgeExample/src/main/res/layout/activity_main.xml b/NeoTermBridgeExample/src/main/res/layout/activity_main.xml deleted file mode 100644 index 36c067f..0000000 --- a/NeoTermBridgeExample/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - -