Skip to content

Commit e1f73f7

Browse files
committed
Updated build files to enable quality tools and deployment. (WIP)
1 parent 37a5253 commit e1f73f7

File tree

10 files changed

+207
-102
lines changed

10 files changed

+207
-102
lines changed

.gitignore

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@
66
*.ap_
77
*.aab
88

9+
910
##
1011
## Files for the ART/Dalvik VM
1112
##
1213

1314
*.dex
1415

16+
1517
## Java class files
1618

1719
*.class
1820

21+
1922
##
2023
## Generated files
2124
##
@@ -25,31 +28,36 @@ gen/
2528
out/
2629
gen-external-apklibs/
2730

31+
2832
##
2933
## Gradle files
3034
##
3135

3236
.gradle/
3337

38+
3439
##
3540
## Local configuration file (sdk path, etc)
3641
##
3742

3843
local.properties
3944
tmp
4045

46+
4147
##
4248
## Proguard folder generated by Eclipse
4349
##
4450

4551
proguard/
4652

53+
4754
##
4855
## Log Files
4956
##
5057

5158
*.log
5259

60+
5361
##
5462
## Android Studio
5563
##
@@ -58,6 +66,7 @@ build/
5866
captures/
5967
.navigation/
6068

69+
6170
##
6271
## Intellij
6372
##
@@ -72,26 +81,20 @@ captures/
7281
# /.idea/assetWizardSettings.xml SHOULD THIS BE EXCLUDED ??
7382
# /.idea/navEditor.xml SHOULD THIS BE EXCLUDED ??
7483

84+
7585
##
7686
## Keystore files
7787
##
7888
*.jks
7989

80-
##
81-
## Eclipse project notes
82-
##
83-
84-
.classpath
85-
.project
86-
.metadata
87-
.settings
8890

8991
##
9092
## Google Services (e.g. APIs or Firebase)
9193
##
9294

9395
google-services.json
9496

97+
9598
##
9699
## Freeline
97100
##
@@ -100,18 +103,23 @@ freeline.py
100103
freeline/
101104
freeline_project_description.json
102105

106+
103107
##
104108
## OSX files
105109
##
106110

107111
.DS_Store
108112

113+
109114
##
110115
## Java
111116
##
117+
112118
*.class
113119

120+
114121
##
115122
## Windows files
116123
##
117-
Thumbs.db
124+
125+
Thumbs.db

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,66 @@
11
apply from: "${rootDir}/buildsystem/dependencies.gradle"
2+
apply plugin: 'com.github.ben-manes.versions'
23

34
buildscript {
5+
ext.versions = [
6+
'minSdk': 14,
7+
'compileSdk': 28,
8+
'errorProne': '2.3.1',
9+
]
410
repositories {
5-
jcenter()
611
google()
12+
jcenter()
13+
maven { url 'https://plugins.gradle.org/m2/' } // Error Prone Plugin
714
}
8-
915
dependencies {
1016
classpath 'com.android.tools.build:gradle:3.3.0-alpha10'
17+
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.6'
18+
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
1119
}
1220
}
1321

14-
allprojects {
22+
subprojects {
23+
group = GROUP
24+
version = VERSION_NAME
25+
1526
repositories {
16-
maven { url 'https://jitpack.io' }
1727
google()
1828
jcenter()
1929
}
30+
31+
apply plugin: 'net.ltgt.errorprone'
32+
33+
tasks.withType(JavaCompile) {
34+
options.compilerArgs += [
35+
'-Xlint:all',
36+
'-Xlint:-serial',
37+
'-Xlint:-deprecation',
38+
]
39+
}
40+
41+
configurations.all {
42+
resolutionStrategy {
43+
eachDependency { details ->
44+
// Force all the error-prone dependencies to use the same version.
45+
if (details.requested.group == 'com.google.errorprone' && details.requested.name.startsWith('error_prone_')) {
46+
details.useVersion versions.errorProne
47+
}
48+
}
49+
}
50+
}
51+
52+
tasks.withType(Test) {
53+
testLogging {
54+
exceptionFormat 'FULL'
55+
showCauses true
56+
showExceptions true
57+
showStackTraces true
58+
}
59+
}
60+
61+
dependencies {
62+
errorprone "com.google.errorprone:error_prone_core:${versions.errorProne}"
63+
}
2064
}
2165

2266
task clean(type: Delete) {

buildsystem/android.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ android {
1313
versionName applicationVersionName
1414
}
1515

16-
// In case we used Java: https://developer.android.com/studio/write/java8-support
17-
compileOptions {
18-
sourceCompatibility JavaVersion.VERSION_1_8
19-
targetCompatibility JavaVersion.VERSION_1_8
20-
}
16+
2117

2218
testOptions {
2319
animationsDisabled = true

gradle.properties

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,13 @@
11
# Project-wide Gradle settings.
2-
3-
4-
5-
6-
7-
8-
9-
10-
USER_ORG=
11-
REPO_URL=http://github.com/cesards/SuperImageView
12-
13-
14-
15-
GROUP=com.codeforvictory.android.superimageview
16-
VERSION_NAME=2.0
17-
POM_DESCRIPTION=Features added on top of am ImageView
18-
POM_URL=
19-
POM_SCM_URL=http://github.com/cesards/SuperImageView/
20-
POM_LICENCE_NAME=The Apache Software License, Version 2.0
21-
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
2+
GROUP=com.codeforvictory
3+
VERSION_NAME=2.0-RC1
4+
POM_DESCRIPTION=SuperImageView, an ImageView with super powers like rounded corners and different image crops not supported by the original widget.
5+
POM_URL=http://github.com/cesards/SuperImageView
6+
POM_SCM_URL=http://github.com/cesards/SuperImageView
7+
POM_SCM_CONNECTION=scm:git:https://github.com/cesards/SuperImageView.git
8+
POM_SCM_DEV_CONNECTION=scm:git:[email protected]:cesards/SuperImageView.git
9+
POM_LICENCE_NAME=The MIT License (MIT)
10+
POM_LICENCE_URL=https://tldrlegal.com/license/mit-license
2211
POM_LICENCE_DIST=repo
23-
24-
25-
26-
27-
POM_SCM_CONNECTION=scm:git:https://github.com/square/leakcanary.git
28-
POM_SCM_DEV_CONNECTION=scm:git:[email protected]:square/leakcanary.git
29-
POM_DEVELOPER_ID=square
30-
POM_DEVELOPER_NAME=Square, Inc.
12+
POM_DEVELOPER_ID=com.codeforvictory
13+
POM_DEVELOPER_NAME=Code For Victory

samples/build.gradle

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,64 @@
1-
apply from: "${rootDir}/buildsystem/android-application.gradle"
2-
//apply from: "${rootDir}/buildsystem/tooling.gradle"
1+
apply plugin: 'com.android.application'
32

4-
dependencies {
5-
implementation 'androidx.core:core:1.0.0-rc01'
6-
implementation project(':superimageview-imagecrop')
7-
implementation project(':superimageview-roundedcorners')
8-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
9-
implementation 'com.google.android.material:material:1.0.0-rc01'
10-
implementation 'com.squareup.picasso:picasso:2.71828'
3+
android {
4+
compileSdkVersion versions.compileSdk
5+
6+
// In case we used Java: https://developer.android.com/studio/write/java8-support
7+
compileOptions {
8+
sourceCompatibility JavaVersion.VERSION_1_8
9+
targetCompatibility JavaVersion.VERSION_1_8
10+
}
11+
12+
defaultConfig {
13+
applicationId "com.example.leakcanary"
14+
minSdkVersion versions.minSdk
15+
targetSdkVersion versions.compileSdk
16+
17+
versionCode 2000
18+
versionName VERSION_NAME
19+
20+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
21+
}
22+
23+
buildTypes {
24+
release {
25+
minifyEnabled true
26+
shrinkResources true
27+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
28+
}
29+
}
30+
31+
lintOptions {
32+
disable 'GoogleAppIndexingWarning'
33+
}
34+
35+
bundle {
36+
density.enableSplit = true
37+
abi.enableSplit = true
38+
language.enableSplit = true
39+
}
40+
41+
/** Due to third party libraries. Not good to exclude everytyhing since APK signature v1 is there */
42+
packagingOptions {
43+
exclude 'META-INF/LICENSE'
44+
exclude 'META-INF/LICENSE.txt'
45+
exclude 'META-INF/NOTICE'
46+
exclude 'META-INF/NOTICE.txt'
47+
exclude 'META-INF/*.version'
48+
}
1149
}
50+
51+
dependencies {
52+
implementation project(':superimageview-imagecrop')
53+
implementation project(':superimageview-roundedcorners')
54+
implementation 'androidx.core:core:1.0.0-rc01'
55+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
56+
implementation 'com.google.android.material:material:1.0.0-rc01'
57+
implementation 'com.squareup.picasso:picasso:2.71828'
58+
59+
testImplementation "junit:junit:4.12"
60+
testImplementation "org.robolectric:robolectric:4.0-alpha-3"
61+
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
62+
androidTestImplementation 'androidx.test:rules:1.1.0-alpha4'
63+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
64+
}

superimageview-imagecrop/build.gradle

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
11
apply plugin: 'com.android.library'
2-
apply from: "${rootDir}/buildsystem/android-library.gradle"
32

43
android {
5-
resourcePrefix 'siv_'
6-
}
7-
4+
resourcePrefix 'siv_'
85

6+
compileSdkVersion versions.compileSdk
97

10-
//apply from: "${rootDir}/gradle/bintray-deployment.gradle"
11-
//android {
12-
// resourcePrefix 'siv_'
13-
//
14-
// compileSdkVersion versions.compileSdk
15-
//
16-
// defaultConfig {
17-
// minSdkVersion versions.minSdk
18-
// }
19-
//
20-
// lintOptions {
21-
// disable 'GoogleAppIndexingWarning'
22-
// }
23-
//
24-
// // TODO replace with https://issuetracker.google.com/issues/72050365 once released.
25-
// libraryVariants.all {
26-
// it.generateBuildConfig.enabled = false
27-
// }
28-
//}
8+
defaultConfig {
9+
minSdkVersion versions.minSdk
10+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" // Espresso
11+
}
2912

13+
lintOptions {
14+
disable 'GoogleAppIndexingWarning'
15+
}
16+
}
3017

18+
apply from: rootProject.file('gradle/checkstyle.gradle')
19+
apply from: rootProject.file('gradle/maven-deployment.gradle')
3120

3221
dependencies {
33-
implementation 'androidx.annotation:annotation:1.0.0-rc01'
34-
implementation 'androidx.core:core:1.0.0-rc01'
35-
implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
36-
37-
38-
api project(':superimageview')
39-
testImplementation 'junit:junit:4.12'
40-
testImplementation 'org.assertj:assertj-core:3.9.1'
41-
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
42-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
22+
implementation 'androidx.annotation:annotation:1.0.0-rc01'
23+
implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
24+
api project(':superimageview')
25+
26+
testImplementation 'junit:junit:4.12'
27+
testImplementation 'org.assertj:assertj-core:3.9.1'
28+
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
29+
androidTestImplementation 'androidx.test:rules:1.1.0-alpha4'
30+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
4331
}

0 commit comments

Comments
 (0)