:dataモジュール作り直し

This commit is contained in:
ろむねこ 2023-12-10 18:02:53 +09:00
parent 6d3d9f001e
commit 03877e3e2d
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
9 changed files with 105 additions and 9 deletions

View File

@ -4,8 +4,6 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="jbr-17" />
<option name="modules">
@ -17,10 +15,6 @@
<option value="$PROJECT_DIR$/component/scanner" />
<option value="$PROJECT_DIR$/component/viewer" />
<option value="$PROJECT_DIR$/data" />
<option value="$PROJECT_DIR$/data/repository" />
<option value="$PROJECT_DIR$/data/source" />
<option value="$PROJECT_DIR$/data/source/database" />
<option value="$PROJECT_DIR$/data/source/preference" />
<option value="$PROJECT_DIR$/feature" />
<option value="$PROJECT_DIR$/feature/common" />
<option value="$PROJECT_DIR$/feature/debug" />

1
data/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

35
data/build.gradle Normal file
View File

@ -0,0 +1,35 @@
plugins {
alias(libs.plugins.com.android.library)
}
android {
namespace 'com.example.lacerta.data'
compileSdk 34
defaultConfig {
minSdk 24
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
}

0
data/consumer-rules.pro Normal file
View File

21
data/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 com.example.lacerta.data;
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("com.example.lacerta.data.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 com.example.lacerta.data;
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

@ -23,7 +23,5 @@ include ':feature:common'
include ':component:scanner'
include ':component:viewer'
include ':component:common'
include ':data:repository'
include ':data:source:database'
include ':data:source:preference'
include ':feature:debug'
include ':data'