Kaynağa Gözat

update gradle配置化

SpringBoots 8 yıl önce
ebeveyn
işleme
dda021d6e1

+ 27 - 24
WeiChat/build.gradle

@@ -1,11 +1,14 @@
 apply plugin: 'com.android.application'
 apply plugin: 'com.getkeepsafe.dexcount'
+apply plugin: 'me.tatarka.retrolambda'
 
 android {
-
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+    
     signingConfigs {
         config {
             storeFile file('C:/sigin/applicationsignname[20150409]')
@@ -14,14 +17,16 @@ android {
             keyPassword '13237658359'
         }
     }
+    
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
+   
     defaultConfig {
-        applicationId "com.xzjmyk.pm.activity"
-        minSdkVersion 14
-        targetSdkVersion 24
-        compileOptions {
-            sourceCompatibility JavaVersion.VERSION_1_7
-            targetCompatibility JavaVersion.VERSION_1_7
-        }
+        applicationId project.applicationId
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
         multiDexEnabled true
         signingConfig signingConfigs.config
     }
@@ -30,9 +35,7 @@ android {
     lintOptions {
         abortOnError false
     }
-
-
-
+    
     packagingOptions {
         exclude 'META-INF/LICENSE.txt'
         exclude 'META-INF/NOTICE.txt'
@@ -50,13 +53,12 @@ android {
     }
     productFlavors {
     }
-
-
+    
 }
 
 buildscript {
     repositories {
-        mavenCentral() // or jcenter()
+        mavenCentral()
     }
 
     dependencies {
@@ -77,16 +79,21 @@ dexcount {
 }
 
 dependencies {
+    //工程
     compile project(':pullToRefershLibraryMy')
     compile project(':MPAndroidChart')
     compile project(':libedittextformlibrary')
     compile project(':libfloatingactionbutton')
     compile project(':libbdupdatesdk')
+    compile project(':library-swipemenu_lv')
+    compile project(':library-viewpager-indicator')
+    compile project(':lib-zxing')
+    compile project(':library-refreshlayout')
+    //架包
     compile files('libs/android-async-http-1.4.5.jar')
     compile files('libs/asmack.jar')
     compile files('libs/BaiduLBS_Android.jar')
     compile files('libs/cyberplayer-sdk.jar')
-    //    compile files('libs/fastjson-1.1.41.jar')
     compile files('libs/httpmime-4.2.jar')
     compile files('libs/nineoldandroids.jar')
     compile files('libs/org.xbill.dns_2.1.6.jar')
@@ -97,9 +104,6 @@ dependencies {
     compile files('libs/volley.jar')
     compile files('libs/xutils.jar')
     compile files('libs/flexjson-2.1.jar')
-    compile project(':library-swipemenu_lv')
-    compile project(':library-viewpager-indicator')
-    compile project(':lib-zxing')
     compile files('libs/SocialSDK_WeiXin_2.jar')
     compile files('libs/SocialSDK_umengwx.jar')
     compile files('libs/SocialSDK_QQZone_3.jar')
@@ -113,12 +117,12 @@ dependencies {
     compile('com.facebook.stetho:stetho:1.4.1') {
         force = true
     }
-    compile project(':library-refreshlayout')
     compile files('src/main/jniLibs/pushservice-5.3.0.99.jar')
     compile files('libs/lite-orm-1.7.0.jar')
     compile files('libs/Msc.jar')
     compile files('libs/zhy_treeview.jar')
-    
+    compile files('libs/core.jar')
+    //依赖库
     compile 'com.alibaba:fastjson:1.2.24'
     compile 'de.hdodenhof:circleimageview:2.1.0'
     compile 'joda-time:joda-time:2.9.4'
@@ -138,7 +142,6 @@ dependencies {
     androidTestCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
     debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
     releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
-    compile files('libs/core.jar')
     compile 'com.android.support:design:24.2.1'
 
 

+ 0 - 1
app_core/commom/.gitignore

@@ -1 +0,0 @@
-/build

+ 0 - 34
app_core/commom/build.gradle

@@ -1,34 +0,0 @@
-apply plugin: 'com.android.library'
-
-
-android {
-    compileSdkVersion 25
-    buildToolsVersion "25.0.3"
-
-
-    defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 25
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
-    }
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
-    }
-}
-
-dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
-    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
-
-    compile 'com.android.support:appcompat-v7:25.3.1'
-    testCompile 'junit:junit:4.12'
-}

+ 0 - 25
app_core/commom/proguard-rules.pro

@@ -1,25 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in C:\Android\sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# 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

+ 0 - 26
app_core/commom/src/androidTest/java/base/android/com/commom/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package base.android.com.commom;
-
-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.*;
-
-/**
- * Instrumentation 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() throws Exception {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getTargetContext();
-
-        assertEquals("base.android.com.commom.test", appContext.getPackageName());
-    }
-}

+ 0 - 2
app_core/commom/src/main/AndroidManifest.xml

@@ -1,2 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="base.android.com.commom" />

+ 0 - 3
app_core/commom/src/main/res/values/strings.xml

@@ -1,3 +0,0 @@
-<resources>
-    <string name="app_name">commom</string>
-</resources>

+ 0 - 17
app_core/commom/src/test/java/base/android/com/commom/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package base.android.com.commom;
-
-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() throws Exception {
-        assertEquals(4, 2 + 2);
-    }
-}

+ 6 - 12
app_core/imageload/build.gradle

@@ -1,19 +1,13 @@
 apply plugin: 'com.android.library'
 
-
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 11
app_core/network/build.gradle

@@ -2,18 +2,13 @@ apply plugin: 'com.android.library'
 
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/MPAndroidChart/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 10
app_third/lib-zxing/build.gradle

@@ -1,17 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/libbdupdatesdk/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/libedittextformlibrary/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/libfloatingactionbutton/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 7
app_third/library-refreshlayout/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion '25.0.0'
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 8
-        versionName "1.2.3"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7

+ 6 - 7
app_third/library-swipemenu_lv/build.gradle

@@ -1,15 +1,14 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
     resourcePrefix "swipemenulistview"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 5
app_third/library-viewpager-indicator/build.gradle

@@ -1,12 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
 
     buildTypes {

+ 6 - 7
app_third/materialdialogs/build.gradle

@@ -1,14 +1,13 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
-
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
     buildTypes {
         release {

+ 6 - 4
app_third/pullToRefershLibraryMy/build.gradle

@@ -1,10 +1,12 @@
 apply plugin: 'com.android.library'
 android {
-    compileSdkVersion 24
-    buildToolsVersion "25.0.0"
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
     defaultConfig {
-        minSdkVersion 9
-        targetSdkVersion 24
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.android.versionCode
+        versionName rootProject.ext.android.versionName
     }
 
     buildTypes {

+ 2 - 4
build.gradle

@@ -1,4 +1,4 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply from: "version.gradle"
 
 buildscript {
     repositories {
@@ -10,12 +10,10 @@ buildscript {
         classpath 'com.android.tools.build:gradle:2.3.2'
         classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
         classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
+        classpath 'me.tatarka:gradle-retrolambda:3.2.2'
     }
 }
 
-
-
-
 allprojects {
     repositories {
         jcenter()

+ 3 - 20
gradle.properties

@@ -1,23 +1,6 @@
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-# Default value: -Xmx10248m -XX:MaxPermSize=256m
-# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
-
 android.useDeprecatedNdk=true
 org.gradle.daemon=true
 org.gradle.parallel=true
-org.gradle.jvmargs=-Xmx5120m
+org.gradle.jvmargs=-Xmx5120m
+
+applicationId=com.xzjmyk.pm.activity

+ 2 - 2
settings.gradle

@@ -4,7 +4,7 @@ include ':WeiChat'
 //核心模块
 include ':network'
 include ':imageload'
-include  ':commom'
+include  ':common'
 
 //第三库模块
 include ':lib-zxing'
@@ -21,7 +21,7 @@ include ':pullToRefershLibraryMy'
 //核心模块
 project(':network').projectDir = new File('app_core/network')
 project(':imageload').projectDir = new File('app_core/imageload')
-project(':commom').projectDir = new File('app_core/commom')
+project(':common').projectDir = new File('app_core/common')
 
 
 //第三库模块

+ 2 - 0
version.gradle

@@ -1,5 +1,7 @@
 /*
 Shared gradle properties
+    android:versionCode="111"
+    android:versionName="5.8.9"
 */
 
 ext {