Skip to content

Commit 041b4af

Browse files
committed
AucFrame 之统一管理 Gradle
0 parents  commit 041b4af

File tree

68 files changed

+1263
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1263
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.iml
2+
.gradle
3+
local.properties
4+
.idea
5+
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild
9+
.cxx
10+
*.phrof
11+
__api__.json
12+
__bus__.json
13+
/apk

build.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
ext.kotlin_version = '1.3.31'
5+
repositories {
6+
google()
7+
jcenter()
8+
9+
}
10+
dependencies {
11+
classpath 'com.android.tools.build:gradle:3.5.0-beta05'
12+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13+
// NOTE: Do not place your application dependencies here; they belong
14+
// in the individual module build.gradle files
15+
}
16+
}
17+
18+
allprojects {
19+
repositories {
20+
google()
21+
jcenter()
22+
23+
}
24+
}
25+
26+
task clean(type: Delete) {
27+
delete rootProject.buildDir
28+
}

buildAPP.gradle

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apply {
2+
plugin "com.android.application"
3+
plugin "kotlin-android"
4+
plugin "kotlin-android-extensions"
5+
}
6+
7+
android {
8+
compileSdkVersion Config.compileSdkVersion
9+
defaultConfig {
10+
minSdkVersion Config.minSdkVersion
11+
versionCode Config.versionCode
12+
versionName Config.versionName
13+
applicationId Config.applicationId + suffix
14+
targetSdkVersion Config.targetSdkVersion
15+
multiDexEnabled true
16+
resValue "string", "app_name", Config.appName + suffix
17+
}
18+
19+
buildTypes {
20+
debug {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23+
}
24+
release {
25+
minifyEnabled true
26+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27+
}
28+
}
29+
30+
packagingOptions {
31+
exclude 'META-INF/*'
32+
}
33+
34+
dexOptions {
35+
preDexLibraries true
36+
javaMaxHeapSize "8g"
37+
maxProcessCount 8
38+
dexInProcess = true
39+
}
40+
}
41+
42+
dependencies {
43+
// LeakCanary
44+
debugImplementation Config.depConfig.leakcanary.android
45+
debugImplementation Config.depConfig.leakcanary.support_fragment
46+
releaseImplementation Config.depConfig.leakcanary.android_no_op
47+
}
48+
49+
def getSuffix() {
50+
if (project.path == ":feature:launcher:app") return ""
51+
return project.path.replace(":", "_").substring(":feature".length(), project.path.length() - ":app".length())
52+
}

buildLib.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apply {
2+
plugin "com.android.library"
3+
plugin "kotlin-android"
4+
plugin "kotlin-android-extensions"
5+
}
6+
7+
android {
8+
compileSdkVersion Config.compileSdkVersion
9+
10+
defaultConfig {
11+
minSdkVersion Config.minSdkVersion
12+
versionCode Config.versionCode
13+
versionName Config.versionName
14+
15+
consumerProguardFiles 'proguard-rules.pro'
16+
}
17+
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
25+
lintOptions {
26+
abortOnError false
27+
}
28+
}

buildSrc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

buildSrc/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repositories {
2+
google()
3+
jcenter()
4+
}
5+
6+
apply {
7+
plugin 'groovy'
8+
plugin 'java-gradle-plugin'
9+
}
10+
11+
dependencies {
12+
implementation gradleApi()
13+
implementation localGroovy()
14+
implementation "commons-io:commons-io:2.6"
15+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
class Config {
2+
3+
static applicationId = 'com.blankj.aucframe' // TODO: MODIFY
4+
static appName = 'AucFrame' // TODO: MODIFY
5+
6+
static compileSdkVersion = 27 // TODO: MODIFY
7+
static minSdkVersion = 21 // TODO: MODIFY
8+
static targetSdkVersion = 27 // TODO: MODIFY
9+
static versionCode = 1_000_000 // TODO: MODIFY
10+
static versionName = '1.0.0'// E.g. 1.9.72 => 1,009,072 // TODO: MODIFY
11+
12+
static kotlin_version = '1.3.10'
13+
static support_version = '27.1.1'
14+
static leakcanary_version = '1.6.3'
15+
16+
static depConfig = [
17+
plugin : [
18+
gradle: "com.android.tools.build:gradle:3.3.0",
19+
kotlin: "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version",
20+
],
21+
support : [
22+
appcompat_v7: "com.android.support:appcompat-v7:$support_version",
23+
design : "com.android.support:design:$support_version",
24+
multidex : "com.android.support:multidex:1.0.2",
25+
constraint : "com.android.support.constraint:constraint-layout:1.1.3",
26+
],
27+
kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version",
28+
utilcode : "com.blankj:utilcode:1.25.0",
29+
free_proguard: "com.blankj:free-proguard:1.0.1",
30+
swipe_panel : "com.blankj:swipe-panel:1.1",
31+
32+
leakcanary : [
33+
android : "com.squareup.leakcanary:leakcanary-android:$leakcanary_version",
34+
android_no_op : "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version",
35+
support_fragment: "com.squareup.leakcanary:leakcanary-support-fragment:$leakcanary_version",
36+
],
37+
]
38+
}

feature/feature0/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

feature/feature0/app/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apply {
2+
from "${project.rootDir.path}/buildApp.gradle"
3+
}
4+
5+
dependencies {
6+
api project(":feature:feature0:pkg")
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.blankj.feature0.app">
4+
5+
<application
6+
android:name="com.blankj.feature0.app.Feature0App"
7+
android:allowBackup="false"
8+
android:icon="@mipmap/ic_launcher"
9+
android:label="@string/app_name"
10+
android:theme="@style/AppTheme">
11+
<activity android:name="com.blankj.feature0.pkg.Feature0Activity">
12+
<intent-filter>
13+
<action android:name="android.intent.action.VIEW" />
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.blankj.feature0.app;
2+
3+
import com.blankj.common.CommonApplication;
4+
5+
6+
public class Feature0App extends CommonApplication {
7+
}

feature/feature0/export/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

feature/feature0/export/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apply {
2+
from "${project.rootDir.path}/buildLib.gradle"
3+
}
4+
5+
dependencies {
6+
api project(":lib:common")
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<manifest package="com.blankj.feature0.export" />

feature/feature0/pkg/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

feature/feature0/pkg/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apply {
2+
from "${project.rootDir.path}/buildLib.gradle"
3+
}
4+
5+
dependencies {
6+
api project(":feature:feature0:export")
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.blankj.feature0.pkg">
3+
4+
<application>
5+
<activity
6+
android:name=".Feature0Activity"
7+
android:configChanges="orientation|keyboardHidden|screenSize"
8+
android:screenOrientation="user"
9+
android:windowSoftInputMode="stateHidden" />
10+
</application>
11+
12+
13+
</manifest>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.blankj.feature0.pkg;
2+
3+
import android.os.Bundle;
4+
import android.support.annotation.Nullable;
5+
import android.view.View;
6+
7+
import com.blankj.common.CommonTitleActivity;
8+
9+
10+
public class Feature0Activity extends CommonTitleActivity {
11+
12+
@Override
13+
public CharSequence bindTitle() {
14+
return getString(R.string.feature0_title);
15+
}
16+
17+
@Override
18+
public boolean isSwipeBack() {
19+
return false;
20+
}
21+
22+
@Override
23+
public int bindLayout() {
24+
return R.layout.feature0_activity;
25+
}
26+
27+
@Override
28+
public void initView(@Nullable Bundle savedInstanceState, @Nullable View contentView) {
29+
30+
}
31+
32+
@Override
33+
public void doBusiness() {
34+
35+
}
36+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:orientation="vertical"
6+
android:padding="16dp">
7+
8+
<Button
9+
android:layout_width="match_parent"
10+
android:layout_height="wrap_content"
11+
android:text="@string/start_feature1"
12+
android:textAllCaps="false" />
13+
14+
</LinearLayout>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<resources>
2+
<string name="feature0_title">Feature0</string>
3+
<string name="start_feature1">Start Feature1</string>
4+
</resources>

feature/feature1/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

0 commit comments

Comments
 (0)