Skip to content

Commit 5fd90a7

Browse files
committed
Migration to Gradle
1 parent 628d156 commit 5fd90a7

File tree

74 files changed

+2232
-1069
lines changed

Some content is hidden

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

74 files changed

+2232
-1069
lines changed

.gitignore

Lines changed: 73 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,74 @@
1-
# Intellij #
2-
############
3-
.idea
1+
### Android template
2+
# Built application files
3+
*.apk
4+
*.ap_
5+
6+
# Files for the ART/Dalvik VM
7+
*.dex
8+
9+
# Java class files
10+
*.class
11+
12+
# Generated files
13+
bin/
14+
gen/
15+
out/
16+
17+
# Gradle files
18+
.gradle/
19+
build/
20+
21+
# Local configuration file (sdk path, etc)
22+
local.properties
23+
24+
# Proguard folder generated by Eclipse
25+
proguard/
26+
27+
# Log Files
28+
*.log
29+
30+
# Android Studio Navigation editor temp files
31+
.navigation/
32+
33+
# Android Studio captures folder
34+
captures/
35+
36+
# IntelliJ
437
*.iml
5-
gen-external-apklibs/
6-
7-
# Eclipse #
8-
###########
9-
.settings
10-
.project
11-
.classpath
12-
13-
# Build Output #
14-
################
15-
target
16-
bin
17-
18-
# Android #
19-
###########
20-
gen
21-
22-
# MacOsX #
23-
##########
24-
.DS_Store
25-
26-
# Other #
27-
#########
28-
.~lock*
29-
tmp
38+
.idea/dictionaries
39+
.idea/libraries
40+
.idea/caches
41+
.idea/.name
42+
.idea/assetWizardSettings.xml
43+
.idea/encodings.xml
44+
.idea/compiler.xml
45+
.idea/gradle.xml
46+
.idea/misc.xml
47+
.idea/modules.xml
48+
.idea/runConfigurations.xml
49+
.idea/tasks.xml
50+
.idea/vcs.xml
51+
.idea/workspace.xml
52+
53+
# Keystore files
54+
# Uncomment the following line if you do not want to check your keystore files in.
55+
#*.jks
56+
57+
# External native build folder generated in Android Studio 2.2 and later
58+
.externalNativeBuild
59+
60+
# Google Services (e.g. APIs or Firebase)
61+
google-services.json
62+
63+
# Freeline
64+
freeline.py
65+
freeline/
66+
freeline_project_description.json
67+
68+
# fastlane
69+
fastlane/report.xml
70+
fastlane/Preview.html
71+
fastlane/screenshots
72+
fastlane/test_output
73+
fastlane/readme.md
74+

.idea/codeStyles/Project.xml

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

.idea/inspectionProfiles/Project_Default.xml

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

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
Change Log
22
==========
33

4-
Version 1.1.2 *(2016-04-23)*
4+
Version 1.2.0 *(IN DEVELOPMENT)*
55
--------------------------------
66

7+
* **CHANGED**: minSdkVersion is now 14
8+
* **CHANGED**: Converted project to Gradle
9+
* **CHANGED**: Compile with Java 8 syntax
10+
11+
Version 1.1.2 *(2016-04-23)*
12+
----------------------------
13+
714
* **minSdkVersion is now 8**
815
* Added spanish translation (#4)
916
* Updated dependencies
@@ -14,7 +21,7 @@ Version 1.1.1 *(2014-06-01)*
1421
* Updated dependencies
1522

1623
Version 1.1.0 *(2014-02-02)*
17-
--------------------------------
24+
----------------------------
1825

1926
* **Switched to aar packaging**
2027

Jenkinsfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
pipeline {
2+
options {
3+
buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: '15'))
4+
}
5+
agent any
6+
stages {
7+
stage('Prepare environment') {
8+
steps {
9+
sh "yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses > /dev/null"
10+
}
11+
}
12+
stage('Build') {
13+
steps {
14+
sh './gradlew clean build'
15+
junit allowEmptyResults: true, testResults: '**/build/test-results/testDebugUnitTest/TEST-*.xml'
16+
jacoco classPattern: '**/build/intermediates/javac/debug,**/build/intermediates/javac/debugUnitTest', exclusionPattern: '**/R.class,**/R$*.class,**/BuildConfig.*,**/*$ViewInjector*.*,**/*$ViewBinder*.*', execPattern: '**/testDebugUnitTest.exec'
17+
}
18+
}
19+
stage("Analyze") {
20+
steps {
21+
withSonarQubeEnv('PSDev') {
22+
sh './gradlew sonarqube'
23+
}
24+
timeout(time: 1, unit: 'HOURS') {
25+
waitForQualityGate abortPipeline: false
26+
}
27+
}
28+
}
29+
stage("Deploy") {
30+
steps {
31+
sh './gradlew publish'
32+
zip dir: 'build/m2repository', glob: '', zipFile: 'build/m2repository.zip', archive: true
33+
}
34+
}
35+
}
36+
post {
37+
always {
38+
archiveArtifacts allowEmptyArchive: true, artifacts: '**/build/reports/,sample/build/outputs/apk/debug/sample-debug.apk', fingerprint: true
39+
}
40+
}
41+
}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FormValidations [![Build Status](https://ci.psdev.de/job/PSDevFormValidations/badge/icon)](https://ci.psdev.de/job/PSDevFormValidations/) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.psdev.formvalidations/formvalidations/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.psdev.formvalidations/formvalidations)
1+
FormValidations [![Build Status](https://ci.psdev.de/job/PSDevFormValidations/badge/icon)](https://ci.psdev.de/job/PSDevFormValidations/) [![Coverage](https://sonar.psdev.de/api/project_badges/measure?project=de.psdev.formvalidations&metric=coverage)](https://sonar.psdev.de/dashboard?id=de.psdev.formvalidations) [![Lines of Code](https://sonar.psdev.de/api/project_badges/measure?project=de.psdev.formvalidations&metric=ncloc)](https://sonar.psdev.de/dashboard?id=de.psdev.formvalidations) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.psdev.formvalidations/formvalidations/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.psdev.formvalidations/formvalidations)
22
===============
33

44
FormValidations is an open source library to validate forms in Android apps.
@@ -54,13 +54,13 @@ Download [the latest Release][1] or grab via Maven:
5454
<dependency>
5555
<groupId>de.psdev.formvalidations</groupId>
5656
<artifactId>formvalidations</artifactId>
57-
<version>1.1.2</version>
57+
<version>1.2.0</version>
5858
<type>aar</type>
5959
</dependency>
6060
```
6161
or Gradle:
6262
```groovy
63-
compile 'de.psdev.formvalidations:formvalidations:1.1.2'
63+
implementation 'de.psdev.formvalidations:formvalidations:1.2.0'
6464
```
6565

6666
Sample
@@ -78,7 +78,7 @@ Contributors
7878

7979
Thank you to all the contributors of this project, namely:
8080

81-
- [Cristian Hernandez](https://github.com/PSDev/LicensesDialog/commits?author=devcodaltec)
81+
- [Cristian Hernandez](https://github.com/PSDev/FormValidations/commits?author=devcodaltec)
8282

8383
License
8484
-------
@@ -121,6 +121,6 @@ License
121121
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
122122

123123
[1]: https://github.com/PSDev/FormValidations/releases
124-
[2]: https://ci.psdev.de/job/PSDevFormValidations/lastSuccessfulBuild/artifact/sample/target/
124+
[2]: https://ci.psdev.de/job/PSDevFormValidations/lastSuccessfulBuild/artifact/sample/build/outputs/apk/debug/
125125
[3]: https://github.com/zasadnyy/z-validations
126126
[4]: http://about.me/vitaliy.zasadnyy

build.gradle

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
buildscript {
2+
ext {
3+
// Plugin versions
4+
androidGradlePluginVersion = "3.2.0"
5+
sonarqubeGradlePluginVersion = "2.6.2"
6+
// Dependency versions
7+
appcompatVersion = "28.0.0"
8+
butterknife = "8.8.1"
9+
supportAnnotationsVersion = "28.0.0"
10+
}
11+
repositories {
12+
google()
13+
mavenCentral()
14+
jcenter()
15+
}
16+
dependencies {
17+
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
18+
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:$sonarqubeGradlePluginVersion"
19+
}
20+
}
21+
22+
allprojects {
23+
group "de.psdev.formvalidations"
24+
version "1.2.0-SNAPSHOT"
25+
26+
repositories {
27+
google()
28+
mavenCentral()
29+
jcenter()
30+
}
31+
32+
apply from: rootProject.file('gradle/versioning.gradle')
33+
}
34+
35+
task clean(type: Delete) {
36+
delete rootProject.buildDir
37+
}
38+
39+
task wrapper(type: Wrapper) {
40+
gradleVersion = '4.10.2'
41+
distributionType = "all"
42+
}

formvalidations/.gitignore

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

formvalidations/build.gradle

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: "org.sonarqube"
3+
apply from: rootProject.file('gradle/jacoco.gradle')
4+
5+
project.description = "FormValidations (Library)"
6+
7+
android {
8+
compileSdkVersion 28
9+
buildToolsVersion "28.0.3"
10+
11+
defaultConfig {
12+
minSdkVersion 14
13+
targetSdkVersion 28
14+
15+
versionName project.version
16+
versionCode buildVersionCode()
17+
18+
buildConfigField 'String', 'GIT_SHA', "\"${gitScmVersion()}\""
19+
}
20+
21+
compileOptions {
22+
sourceCompatibility JavaVersion.VERSION_1_8
23+
targetCompatibility JavaVersion.VERSION_1_8
24+
}
25+
26+
lintOptions {
27+
lintConfig rootProject.file('lint.xml')
28+
}
29+
30+
testOptions {
31+
unitTests {
32+
includeAndroidResources = true
33+
}
34+
}
35+
36+
buildTypes {
37+
release {
38+
minifyEnabled false
39+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
40+
}
41+
}
42+
}
43+
44+
dependencies {
45+
// Testing
46+
testImplementation 'junit:junit:4.12'
47+
testImplementation 'org.robolectric:robolectric:3.8'
48+
49+
// Support Annotations
50+
implementation "com.android.support:support-annotations:$supportAnnotationsVersion"
51+
}
52+
53+
sonarqube {
54+
properties {
55+
property "sonar.projectKey", "$project.group"
56+
property "sonar.projectName", "FormValidations"
57+
property "sonar.exclusions", [].join(',')
58+
property "sonar.scm.provider", "git"
59+
property "sonar.android.lint.report", "build/reports/lint-results.xml"
60+
property "sonar.junit.reportPaths", "build/test-results/testDebugUnitTest"
61+
property "sonar.jacoco.reportPaths", "build/jacoco/testDebugUnitTest.exec"
62+
}
63+
}
64+
65+
apply from: rootProject.file('gradle/publishMavenLocal.gradle')

library/AndroidManifest.xml renamed to formvalidations/src/main/AndroidManifest.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@
1616
-->
1717

1818
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
19-
android:versionCode="1001002"
20-
android:versionName="1.1.2-SNAPSHOT"
2119
package="de.psdev.formvalidations">
2220

23-
<uses-sdk
24-
android:minSdkVersion="8"
25-
android:targetSdkVersion="23" />
2621
<application />
2722
</manifest>

0 commit comments

Comments
 (0)