Skip to content

Commit

Permalink
see 07/17 log
Browse files Browse the repository at this point in the history
  • Loading branch information
Blankj committed Jul 17, 2018
1 parent abc7a5d commit e9f7a77
Show file tree
Hide file tree
Showing 14 changed files with 320 additions and 189 deletions.
62 changes: 4 additions & 58 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,61 +1,7 @@
apply plugin: 'com.android.application'

File signPropertiesFile = file('sign/keystore.properties')

android {
compileSdkVersion compile_sdk_version
defaultConfig {
applicationId "com.blankj.androidutilcode"
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
}

if (signPropertiesFile.exists()) {
Properties properties = new Properties()
properties.load(new FileInputStream(signPropertiesFile))
signingConfigs {
release {
storeFile file(properties['keystore'])
storePassword properties['storePassword']
keyAlias properties['keyAlias']
keyPassword properties['keyPassword']
}
}
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (signPropertiesFile.exists()) {
signingConfig signingConfigs.release
}
}
}

sourceSets {
main.res.srcDirs += 'src/main/res_core'
main.res.srcDirs += 'src/main/res_sub'
}

lintOptions {
abortOnError false
}
plugins {
id "com.android.application"
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':utilcode')
implementation project(':subutil')
configAndroidDomain project

implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:design:$support_version"
implementation 'com.r0adkll:slidableactivity:2.0.5'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
// LeakCanary
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
// implementation 'com.blankj:utilcode:1.17.2'
}
configAppDependencies project
5 changes: 4 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.blankj.androidutilcode">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Expand Down Expand Up @@ -56,6 +57,7 @@
android:windowSoftInputMode="stateHidden|adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Expand Down Expand Up @@ -188,7 +190,8 @@
</activity>
<activity
android:name=".feature.sub.pinyin.PinyinActivity"
android:launchMode="singleTop" />
android:launchMode="singleTop"
android:screenOrientation="landscape" />

<meta-data
android:name="app_meta_data"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Util</string>
<string name="core_util">Core Util</string>
<string name="sub_util">Sub Util</string>

Expand Down
16 changes: 5 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
apply from: 'version.gradle'
apply from: 'config.gradle'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'

classpath "tech.harmonysoft:traute-gradle:1.1.8"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
dependencies {
classpath depConfig.gradle
}
}

allprojects {
apply plugin: "tech.harmonysoft.oss.traute"
repositories {
google()
jcenter()
Expand All @@ -28,8 +22,8 @@ allprojects {

resolutionStrategy.eachDependency {
if (it.requested.group == 'com.android.support'
&& it.requested.name != 'multidex') {
it.useVersion support_version
&& !it.requested.name.contains('multidex')) {
it.useVersion versionConfig.support
}
}
}
Expand Down
185 changes: 185 additions & 0 deletions config.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
ext {
androidConfig = [
applicationId : 'com.blankj.androidutilcode',
appName : 'Util',

compileSdkVersion: 27,
minSdkVersion : 14,
targetSdkVersion : 27,
versionCode : 1_017_004,
versionName : '1.17.4'// E.g 1.9.72 => 1,009,072
]

versionConfig = [
// plugin
gradle : '3.1.3',
kotlin : '1.2.30',
// lib
support : '27.1.0',
gson : '2.8.2',
glide : '4.7.1',
leakcanary : '1.5.4',
// test
junit : '4.12',
robolectric: '3.1.2'
]

depConfig = [
gradle : "com.android.tools.build:gradle:$versionConfig.gradle",
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versionConfig.kotlin",

support : [
appcompat_v7: "com.android.support:appcompat-v7:$versionConfig.support",
design : "com.android.support:design:$versionConfig.support",
],
leakcanary : [
android : "com.squareup.leakcanary:leakcanary-android:$versionConfig.leakcanary",
android_no_op: "com.squareup.leakcanary:leakcanary-android-no-op:$versionConfig.leakcanary",
],
gson : "com.google.code.gson:gson:$versionConfig.gson",
glide : "com.github.bumptech.glide:glide:$versionConfig.glide",

junit : "junit:junit:$versionConfig.junit",
robolectric: "org.robolectric:robolectric:$versionConfig.robolectric",
]

configAndroidDomain = this.&configAndroidDomain
configAppDependencies = this.&configAppDependencies
configUtilCodeDependencies = this.&configUtilCodeDependencies
configSubUtilDependencies = this.&configSubUtilDependencies
}

def configAndroidDomain(Project pro) {
if (pro.plugins.hasPlugin("com.android.application")) {
configAppAndroidDomain(pro)
} else {
configLibAndroidDomain(pro)
}
}

def configAppAndroidDomain(Project pro) {
configField(pro)
configSigning(pro)
pro.android {
compileSdkVersion androidConfig.compileSdkVersion
defaultConfig {
applicationId androidConfig.applicationId
minSdkVersion androidConfig.minSdkVersion
targetSdkVersion androidConfig.targetSdkVersion
versionCode androidConfig.versionCode
versionName androidConfig.versionName
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets {
main.res.srcDirs += 'src/main/res_core'
main.res.srcDirs += 'src/main/res_sub'
}

lintOptions {
abortOnError false
}
}
}

def configField(Project pro) {
pro.android.defaultConfig {
resValue "string", "app_name", androidConfig.appName
}
}

def configSigning(Project pro) {
File signPropertiesFile = file('sign/keystore.properties')
if (!signPropertiesFile.exists()) return
pro.android {
Properties properties = new Properties()
properties.load(new FileInputStream(signPropertiesFile))
signingConfigs {
release {
storeFile file(properties['keystore'])
storePassword properties['storePassword']
keyAlias properties['keyAlias']
keyPassword properties['keyPassword']
}
}
buildTypes.release.signingConfig signingConfigs.release
}
}

def configLibAndroidDomain(Project pro) {
pro.android {
compileSdkVersion androidConfig.compileSdkVersion
defaultConfig {
minSdkVersion androidConfig.minSdkVersion
versionCode androidConfig.versionCode
versionName androidConfig.versionName
}

buildTypes {
release {
minifyEnabled false
// consumerProguardFiles 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
}
}
}


def configAppDependencies(Project pro) {
pro.dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':utilcode')
implementation project(':subutil')

implementation depConfig.support.appcompat_v7
implementation depConfig.support.design
implementation 'com.r0adkll:slidableactivity:2.0.5'
// LeakCanary
debugImplementation depConfig.leakcanary.android
releaseImplementation depConfig.leakcanary.android_no_op
// implementation 'com.blankj:utilcode:1.17.2'
}
}

def configUtilCodeDependencies(Project pro) {
pro.dependencies {
compileOnly depConfig.support.appcompat_v7
compileOnly depConfig.support.design

testImplementation depConfig.junit
testImplementation depConfig.robolectric
testImplementation depConfig.support.appcompat_v7
}
}

def configSubUtilDependencies(Project pro) {
pro.dependencies {
compileOnly depConfig.support.appcompat_v7
compileOnly depConfig.support.design

api depConfig.gson
api(depConfig.glide) {
exclude group: "com.android.support"
}

testImplementation depConfig.junit
testImplementation depConfig.robolectric
}
}
File renamed without changes.
File renamed without changes.
46 changes: 5 additions & 41 deletions subutil/build.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
apply plugin: 'com.android.library'
apply from: 'readme.gradle'

android {
compileSdkVersion compile_sdk_version
defaultConfig {
minSdkVersion min_sdk_version
versionCode version_code
versionName version_name
}

buildTypes {
release {
minifyEnabled false
// consumerProguardFiles 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
}
apply {
plugin('com.android.library')
from('readme.gradle')
}

dependencies {
compileOnly "com.android.support:appcompat-v7:$support_version"
compileOnly "com.android.support:design:$support_version"

testImplementation "junit:junit:$junit_version"
testImplementation "org.robolectric:robolectric:$robolectric_version"

api "com.google.code.gson:gson:$gson_version"
configAndroidDomain project

// glide
api ("com.github.bumptech.glide:glide:$glide_version") {
exclude group: "com.android.support"
}
}
configSubUtilDependencies project
3 changes: 2 additions & 1 deletion update_log.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* 18/06/29 修复 IntentUtils 分享图片判断逻辑,CacheDiskUtils 可放入 byte[0],发布 1.17.3
* 18/07/16 新增 ScreenUtils#adaptPortraitScreen 和 ScreenUtils#adaptLandscapeScreen,发布 1.17.3
* 18/07/13 修复 IntentUtils 分享图片判断逻辑,CacheDiskUtils 可放入 byte[0]
* 18/06/29 修复 FragmentUtils 中 getFragmentManager 空指针错误,发布 1.17.2
* 18/06/27 新增 UriUtils#uri2File
* 18/06/25 新增 KeyboardUtils#fixAndroidBug5497,发布 1.17.1 版本
Expand Down
Loading

0 comments on commit e9f7a77

Please sign in to comment.