From 510d31544f7fa317c339006e39d2296266e70cd0 Mon Sep 17 00:00:00 2001 From: r-ca Date: Thu, 14 Dec 2023 04:10:36 +0900 Subject: [PATCH] =?UTF-8?q?=E5=9E=8B=E3=82=92=E7=AE=A1=E7=90=86=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/.gitignore | 1 + model/build.gradle | 35 +++++++++++++++++++ model/consumer-rules.pro | 0 model/proguard-rules.pro | 21 +++++++++++ .../model/ExampleInstrumentedTest.java | 26 ++++++++++++++ model/src/main/AndroidManifest.xml | 4 +++ .../nem/lacerta/model/ExampleUnitTest.java | 17 +++++++++ settings.gradle | 1 + 8 files changed, 105 insertions(+) create mode 100644 model/.gitignore create mode 100644 model/build.gradle create mode 100644 model/consumer-rules.pro create mode 100644 model/proguard-rules.pro create mode 100644 model/src/androidTest/java/one/nem/lacerta/model/ExampleInstrumentedTest.java create mode 100644 model/src/main/AndroidManifest.xml create mode 100644 model/src/test/java/one/nem/lacerta/model/ExampleUnitTest.java diff --git a/model/.gitignore b/model/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/model/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/model/build.gradle b/model/build.gradle new file mode 100644 index 00000000..6b74aa6e --- /dev/null +++ b/model/build.gradle @@ -0,0 +1,35 @@ +plugins { + alias(libs.plugins.com.android.library) +} + +android { + namespace 'one.nem.lacerta.model' + compileSdk 34 + + defaultConfig { + minSdk 26 + + 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 libs.androidx.appcompat + implementation libs.com.google.android.material + testImplementation libs.junit + androidTestImplementation libs.androidx.test.ext.junit + androidTestImplementation libs.androidx.test.espresso.core +} \ No newline at end of file diff --git a/model/consumer-rules.pro b/model/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/model/proguard-rules.pro b/model/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/model/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/model/src/androidTest/java/one/nem/lacerta/model/ExampleInstrumentedTest.java b/model/src/androidTest/java/one/nem/lacerta/model/ExampleInstrumentedTest.java new file mode 100644 index 00000000..d03ea65a --- /dev/null +++ b/model/src/androidTest/java/one/nem/lacerta/model/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package one.nem.lacerta.model; + +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("one.nem.lacerta.model.test", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/model/src/main/AndroidManifest.xml b/model/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a5918e68 --- /dev/null +++ b/model/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/model/src/test/java/one/nem/lacerta/model/ExampleUnitTest.java b/model/src/test/java/one/nem/lacerta/model/ExampleUnitTest.java new file mode 100644 index 00000000..98594712 --- /dev/null +++ b/model/src/test/java/one/nem/lacerta/model/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package one.nem.lacerta.model; + +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 4934d427..fdd87ee0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -27,3 +27,4 @@ include ':feature:debug' include ':data' include ':utils' include ':source' +include ':model'