Commit fdaadff2 by wangtao

feat:添加lib工程

parent 507663aa
......@@ -16,7 +16,9 @@
<option value="$PROJECT_DIR$/lib_app_mine" />
<option value="$PROJECT_DIR$/lib_app_passport" />
<option value="$PROJECT_DIR$/lib_app_plan_trip" />
<option value="$PROJECT_DIR$/lib_common_util" />
<option value="$PROJECT_DIR$/lib_core" />
<option value="$PROJECT_DIR$/lib_network" />
<option value="$PROJECT_DIR$/lib_ui" />
</set>
</option>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -36,7 +36,11 @@ dependencies {
androidTestImplementation deps.runner
androidTestImplementation deps.espresso
implementation deps.kotlin
api project(":lib_ui")
api project(":lib_core")
api project(":lib_network")
api project(":lib_ui")
api project(":lib_common_util")
api deps.annotations
api deps.constraint
......
apply plugin: 'com.android.library'
android {
compileSdkVersion build_config.compile_sdk
buildToolsVersion build_config.build_tool
defaultConfig {
minSdkVersion build_config.min_sdk
targetSdkVersion build_config.target_sdk
versionCode build_config.version_code
versionName build_config.version_name
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation deps.app_compat
testImplementation deps.junit
androidTestImplementation deps.runner
androidTestImplementation deps.espresso
}
# 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
package flutter.com.lib_ui;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.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("flutter.com.lib_ui.test", appContext.getPackageName());
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="flutter.com.lib_ui" />
<resources>
<string name="app_name">lib_core</string>
</resources>
package flutter.com.lib_ui;
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);
}
}
\ No newline at end of file
apply plugin: 'com.android.library'
android {
compileSdkVersion build_config.compile_sdk
buildToolsVersion build_config.build_tool
defaultConfig {
minSdkVersion build_config.min_sdk
targetSdkVersion build_config.target_sdk
versionCode build_config.version_code
versionName build_config.version_name
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation deps.app_compat
testImplementation deps.junit
androidTestImplementation deps.runner
androidTestImplementation deps.espresso
}
# 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
package flutter.com.lib_ui;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.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("flutter.com.lib_ui.test", appContext.getPackageName());
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="flutter.com.lib_ui" />
<resources>
<string name="app_name">lib_core</string>
</resources>
package flutter.com.lib_ui;
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);
}
}
\ No newline at end of file
include ':app',':lib_app_mine', ':lib_ui', ':lib_core', ':lib_app_common', ':lib_app_passport', ':lib_app_login',":lib_app_plan_trip",":lib_app_home",":lib_app_credit"
include ':app',":lib_common_util",":lib_network",':lib_app_mine', ':lib_ui', ':lib_core', ':lib_app_common', ':lib_app_passport', ':lib_app_login',":lib_app_plan_trip",":lib_app_home",":lib_app_credit"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment