From df45d666dd73067a38e5a2160ebf93de6efef535 Mon Sep 17 00:00:00 2001 From: itgaojian Date: Fri, 23 Apr 2021 14:41:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/gradle.xml | 1 + exam/.gitignore | 1 + exam/build.gradle | 38 +++++++++++++++++++ exam/consumer-rules.pro | 0 exam/proguard-rules.pro | 21 ++++++++++ .../exam/ExampleInstrumentedTest.java | 26 +++++++++++++ exam/src/main/AndroidManifest.xml | 5 +++ .../com/tengshisoft/exam/ExampleUnitTest.java | 17 +++++++++ settings.gradle | 1 + 9 files changed, 110 insertions(+) create mode 100644 exam/.gitignore create mode 100644 exam/build.gradle create mode 100644 exam/consumer-rules.pro create mode 100644 exam/proguard-rules.pro create mode 100644 exam/src/androidTest/java/com/tengshisoft/exam/ExampleInstrumentedTest.java create mode 100644 exam/src/main/AndroidManifest.xml create mode 100644 exam/src/test/java/com/tengshisoft/exam/ExampleUnitTest.java diff --git a/.idea/gradle.xml b/.idea/gradle.xml index c704e7b..ad03b2b 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -13,6 +13,7 @@ diff --git a/exam/.gitignore b/exam/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/exam/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/exam/build.gradle b/exam/build.gradle new file mode 100644 index 0000000..d3e57a1 --- /dev/null +++ b/exam/build.gradle @@ -0,0 +1,38 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + defaultConfig { + minSdkVersion 16 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles "consumer-rules.pro" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.2.1' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +} \ No newline at end of file diff --git a/exam/consumer-rules.pro b/exam/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/exam/proguard-rules.pro b/exam/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/exam/proguard-rules.pro @@ -0,0 +1,21 @@ +# 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 \ No newline at end of file diff --git a/exam/src/androidTest/java/com/tengshisoft/exam/ExampleInstrumentedTest.java b/exam/src/androidTest/java/com/tengshisoft/exam/ExampleInstrumentedTest.java new file mode 100644 index 0000000..3ee8813 --- /dev/null +++ b/exam/src/androidTest/java/com/tengshisoft/exam/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.tengshisoft.exam; + +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.getInstrumentation().getTargetContext(); + assertEquals("com.tengshisoft.exam.test", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/exam/src/main/AndroidManifest.xml b/exam/src/main/AndroidManifest.xml new file mode 100644 index 0000000..59b72fa --- /dev/null +++ b/exam/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/exam/src/test/java/com/tengshisoft/exam/ExampleUnitTest.java b/exam/src/test/java/com/tengshisoft/exam/ExampleUnitTest.java new file mode 100644 index 0000000..d712470 --- /dev/null +++ b/exam/src/test/java/com/tengshisoft/exam/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.tengshisoft.exam; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 6f56aca..8d71730 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,3 @@ +include ':exam' rootProject.name='Course' include ':app', ':cm_utils', ':moduleijkplayer'