:feature:common を追加

This commit is contained in:
ろむねこ 2023-12-08 11:15:26 +09:00
parent 3457475c51
commit 108bee3010
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
10 changed files with 113 additions and 1 deletions

View File

@ -12,6 +12,11 @@
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" /> <option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/feature" />
<option value="$PROJECT_DIR$/feature/home" />
<option value="$PROJECT_DIR$/feature/library" />
<option value="$PROJECT_DIR$/feature/scan" />
<option value="$PROJECT_DIR$/feature/search" />
</set> </set>
</option> </option>
</GradleProjectSettings> </GradleProjectSettings>

1
feature/common/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

View File

@ -0,0 +1,35 @@
plugins {
alias(libs.plugins.com.android.library)
}
android {
namespace 'one.nem.lacerta.feature.common'
compileSdk 33
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
}

View File

21
feature/common/proguard-rules.pro vendored Normal file
View File

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

View File

@ -0,0 +1,26 @@
package one.nem.lacerta.feature.common;
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.getInstrumentation().getTargetContext();
assertEquals("one.nem.lacerta.feature.common.test", appContext.getPackageName());
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

View File

@ -0,0 +1,17 @@
package one.nem.lacerta.feature.common;
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

@ -1,5 +1,6 @@
[versions] [versions]
nav = "2.7.5" nav = "2.7.5"
agp = "8.0.2"
[libraries] [libraries]
navigation-fragment = { group="androidx.navigation", name="navigation-fragment", version.ref="nav"} navigation-fragment = { group="androidx.navigation", name="navigation-fragment", version.ref="nav"}
@ -18,3 +19,4 @@ com-google-dagger-hilt-android = { group="com.google.dagger", name="hilt-android
com-google-dagger-hilt-compiler = { group="com.google.dagger", name="hilt-compiler", version="2.44" } com-google-dagger-hilt-compiler = { group="com.google.dagger", name="hilt-compiler", version="2.44" }
[plugins] [plugins]
com-android-library = { id = "com.android.library", version.ref = "agp" }

View File

@ -19,3 +19,4 @@ include ':feature:home'
include ':feature:search' include ':feature:search'
include ':feature:library' include ':feature:library'
include ':feature:scan' include ':feature:scan'
include ':feature:common'