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
This commit is contained in:
imkiva 2021-05-07 18:44:45 +08:00 committed by Kiva Oyama
parent 6fd3582be0
commit 9d466997f7
47 changed files with 9 additions and 41482 deletions

3
.gitignore vendored
View File

@ -11,6 +11,7 @@
# generated files # generated files
bin/ bin/
gen/ gen/
.cxx/
# Local configuration file (sdk path, etc) # Local configuration file (sdk path, etc)
local.properties local.properties
@ -27,8 +28,6 @@ proguard/
*.ipr *.ipr
*.iws *.iws
.idea/ .idea/
*.iml
.gradle .gradle
/local.properties /local.properties
/.idea/workspace.xml /.idea/workspace.xml

View File

@ -6,9 +6,6 @@ dependencies {
compile rootProject.ext.deps["kotlin-stdlib"] compile rootProject.ext.deps["kotlin-stdlib"]
} }
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
buildscript { buildscript {
repositories { repositories {
mavenCentral() mavenCentral()
@ -30,7 +27,6 @@ compileTestKotlin {
jvmTarget = "1.8" jvmTarget = "1.8"
} }
} }
dependencies { dependencies {
testImplementation rootProject.ext.deps["junit"] testImplementation rootProject.ext.deps["junit"]
} }

View File

@ -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
}
}

View File

@ -5,33 +5,27 @@ def libraryVersionName = "1.0"
android { android {
compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
buildToolsVersion '28.0.3'
defaultConfig { defaultConfig {
minSdkVersion rootProject.ext.android.MIN_SDK_VERSION minSdkVersion rootProject.ext.android.MIN_SDK_VERSION
targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION
versionCode libraryVersionCode versionCode libraryVersionCode
versionName libraryVersionName versionName libraryVersionName
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
} }
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
} }
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) 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', { androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
testImplementation rootProject.ext.deps["junit"] testImplementation rootProject.ext.deps["junit"]
} }
apply from: 'bintray.gradle'

View File

@ -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

View File

@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@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());
}
}

View File

@ -1 +0,0 @@
/build

View File

@ -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')
}

View File

@ -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

View File

@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@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());
}
}

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.neoterm.bridge.example">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -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;
}
}
}

View File

@ -1,34 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

View File

@ -1,170 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
tools:context=".MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Run echo hello world"
android:onClick="onRunHelloWorld"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Append echo hello world"
android:onClick="onAppendHelloWorld"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Append echo hello world silently"
android:onClick="onAppendHelloWorldSilently"/>
</LinearLayout>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
</resources>

View File

@ -1,3 +0,0 @@
<resources>
<string name="app_name">NeoTermBridgeExample</string>
</resources>

View File

@ -1,8 +0,0 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>

View File

@ -1,17 +0,0 @@
package io.neoterm.bridge.example;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@ -2,22 +2,18 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
buildToolsVersion rootProject.ext.android.BUILD_TOOL_VERSION
defaultConfig { defaultConfig {
minSdkVersion rootProject.ext.android.MIN_SDK_VERSION minSdkVersion rootProject.ext.android.MIN_SDK_VERSION
targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
} }
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }

View File

@ -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

View File

@ -1,26 +0,0 @@
package io.neoterm;
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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("io.neoterm.test", appContext.getPackageName());
}
}

View File

@ -1,10 +1,8 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android { android {
compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
buildToolsVersion '28.0.3'
defaultConfig { defaultConfig {
applicationId "io.neoterm" applicationId "io.neoterm"
@ -17,7 +15,7 @@ android {
externalNativeBuild { externalNativeBuild {
cmake { cmake {
cppFlags "-std=c++11" cppFlags "-std=c++11"
abiFilters 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a' abiFilters 'arm64-v8a'
} }
} }
sourceSets { sourceSets {
@ -31,9 +29,6 @@ android {
minifyEnabled true minifyEnabled true
zipAlignEnabled true zipAlignEnabled true
shrinkResources true shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFile 'app/proguard-rules.pro'
versionNameSuffix "-${getGitHeadRefsSuffix()}"
} }
} }
externalNativeBuild { externalNativeBuild {

File diff suppressed because it is too large Load Diff

View File

@ -1,99 +0,0 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/kiva/devel/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# 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
-dontpreverify
-printmapping proguardMapping.txt
-keep class io.neoterm.backend.JNI {
*;
}
-keep class android.support.** {
*;
}
#-keep class com.igalata.** {
#*;
#}
-keep class org.jbox2d.** {
*;
}
-keepattributes *Annotation*
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
## Only required if you use AsyncExecutor
#-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
# <init>(java.lang.Throwable);
#}
#skf4j
-dontwarn org.slf4j.**
-dontwarn sun.misc.**
# RxJava
#-keep class rx.** { *; }
-dontwarn rx.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
# Parcelable
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class * implements android.os.Parcelable {
public <fields>;
private <fields>;
}
# Serializable
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
-keep class * extends io.neoterm.framework.database.annotation.* { *; }
-keep interface * extends io.neoterm.framework.database.annotation.* { *; }

View File

@ -1,27 +0,0 @@
package io.neoterm
import io.neoterm.component.codegen.CodeGenComponent
import io.neoterm.component.colorscheme.DefaultColorScheme
import io.neoterm.frontend.component.ComponentManager
import org.junit.Test
/**
* @author kiva
*/
class CodeGenTest {
@Test
fun testCodeGen() {
try {
TestInitializer.init()
} catch (ignore: Throwable) {
}
val codeGenComponent = ComponentManager.getComponent<CodeGenComponent>()
val colorScheme = DefaultColorScheme
val generator = codeGenComponent.newGenerator(colorScheme)
println("Generating using " + generator.getGeneratorName())
println("Result: ")
println(generator.generateCode(colorScheme))
}
}

View File

@ -1,22 +0,0 @@
package io.neoterm
import io.neoterm.frontend.terminal.extrakey.button.IExtraButton
import io.neoterm.frontend.terminal.extrakey.combine.CombinedSequence
import org.junit.Test
/**
* @author kiva
*/
class CombinedKeyTest {
@Test
fun testCombinedKey() {
val key = CombinedSequence.solveString("<Ctrl> <Alt> <F1> q")
println(key.keys)
var chars = "Unchanged"
val XX = key.keys[0]
when (IExtraButton.KEY_CTRL) {
XX -> chars = "Detected ctrl"
}
println(chars)
}
}

View File

@ -1,72 +0,0 @@
package io.neoterm
import io.neoterm.component.colorscheme.ColorSchemeComponent
import io.neoterm.component.colorscheme.NeoColorScheme
import io.neoterm.component.extrakey.NeoExtraKey
import io.neoterm.component.font.FontComponent
import io.neoterm.component.profile.NeoProfile
import io.neoterm.component.profile.ProfileComponent
import io.neoterm.frontend.component.ComponentManager
import io.neoterm.frontend.session.shell.ShellProfile
import org.junit.Test
import java.io.File
/**
* @author kiva
*/
class ConfigureFileTest {
@Test
fun colorConfigureTest() {
try {
TestInitializer.init()
} catch (ignore: Throwable) {
}
val color = NeoColorScheme()
if (color.testLoadConfigure(File("NeoLang/example/color-scheme.nl"))) {
println("colorName: ${color.colorName}")
println("colorVersion: ${color.colorVersion}")
println("background: ${color.backgroundColor}")
println("foreground: ${color.foregroundColor}")
println("color1: ${color.color[1]}")
println("color2: ${color.color[2]}")
}
}
@Test
fun extraKeyConfigureTest() {
try {
TestInitializer.init()
} catch (ignore: Throwable) {
}
val extraKey = NeoExtraKey()
if (extraKey.testLoadConfigure(File("app/src/main/assets/eks/vim.nl"))) {
println("programs: ${extraKey.programNames}")
println("version: ${extraKey.version}")
println("with-default: ${extraKey.withDefaultKeys}")
println("keys: ${extraKey.shortcutKeys}")
}
}
@Test
fun profileConfigureTest() {
try {
TestInitializer.init()
} catch (ignore: Throwable) {
}
val profile = ShellProfile()
profile.testLoadConfigure(File("NeoLang/example/profile.nl"))
println(profile.profileMetaName)
println(profile.profileName)
}
@Test
fun configureFileTest() {
colorConfigureTest()
extraKeyConfigureTest()
profileConfigureTest()
}
}

View File

@ -1,37 +0,0 @@
package io.neoterm
import io.neoterm.component.pm.PackageComponent
import io.neoterm.component.pm.SourceHelper
import io.neoterm.frontend.component.ComponentManager
import junit.framework.Assert.assertEquals
import org.junit.Test
import java.io.File
/**
* @author kiva
*/
class PackageManagerTest {
@Test
fun testSourceUrl() {
val url = "http://7sp0th.iok.la:81/neoterm"
println(SourceHelper.detectSourceFilePrefix(url))
}
@Test
fun testMultilineInListFile() {
try {
ComponentManager.registerComponent(PackageComponent::class.java)
} catch (ignore: Throwable) {
}
val pm = ComponentManager.getComponent<PackageComponent>();
pm.reloadPackages(File("/Users/kiva/1"), false)
System.err.println(pm.packages["rcs"]?.description)
}
@Test
fun testReplaceAll() {
assertEquals("/root/boom.sh".replace("/", "_"), "_root_boom.sh")
}
}

View File

@ -1,12 +0,0 @@
package io.neoterm
import io.neoterm.component.NeoInitializer
/**
* @author kiva
*/
object TestInitializer {
fun init() {
NeoInitializer.initComponents()
}
}

View File

@ -1,38 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.getGitHeadRefsSuffix = { ext.kotlin_version = '1.4.32'
try {
def headFile = new File('.git/HEAD')
if (headFile.exists()) {
String[] strings = headFile.getText('UTF-8').split(" ");
if (strings.size() > 1) {
String refFilePath = '.git/' + strings[1];
def refFile = new File(refFilePath.replace("\n", ""));
return refFile.getText('UTF-8').substring(0, 7)
}
}
} catch (Exception e) {
e.printStackTrace()
}
return ""
}
ext.kotlin_version = '1.3.50'
ext.android = [ ext.android = [
KOTLIN_VERSION : '1.3.50', KOTLIN_VERSION : '1.4.32',
MIN_SDK_VERSION : 21, MIN_SDK_VERSION : 21,
COMPILE_SDK_VERSION : 28, COMPILE_SDK_VERSION : 28,
TARGET_SDK_VERSION : 28, TARGET_SDK_VERSION : 28,
BUILD_TOOL_VERSION : '28.0.3',
JUNIT_VERSION : "4.12" JUNIT_VERSION : "4.12"
] ]
@ -46,14 +20,14 @@ buildscript {
"junit" : "junit:junit:${ext.android.JUNIT_VERSION}" "junit" : "junit:junit:${ext.android.JUNIT_VERSION}"
] ]
repositories { repositories {
maven { url 'https://dl.google.com/dl/android/maven2/' } maven { url 'https://dl.google.com/dl/android/maven2/' }
jcenter() jcenter()
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.1' classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath rootProject.ext.deps["kotlin-gradle-plugin"] classpath rootProject.ext.deps["kotlin-gradle-plugin"]

View File

@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
buildToolsVersion rootProject.ext.android.BUILD_TOOL_VERSION
defaultConfig { defaultConfig {
minSdkVersion rootProject.ext.android.MIN_SDK_VERSION minSdkVersion rootProject.ext.android.MIN_SDK_VERSION
@ -13,10 +12,6 @@ android {
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled true
versionNameSuffix "-${getGitHeadRefsSuffix()}"
}
debug {
versionNameSuffix "-snapshot-${getGitHeadRefsSuffix()}"
} }
} }
} }

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip

View File

@ -1 +0,0 @@

View File

@ -1 +1 @@
include ':app', ':chrome-tabs', ':NeoLang', ':Xorg', ':NeoTermBridge', ':NeoTermBridgeExample' include ':app', ':chrome-tabs', ':NeoLang', ':Xorg', ':NeoTermBridge'