Skip to content

Commit 7199965

Browse files
committed
Better Organizing the codebase with the new library package.
1 parent 3f66618 commit 7199965

File tree

107 files changed

+2733
-2615
lines changed

Some content is hidden

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

107 files changed

+2733
-2615
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Overview
22
=
33

4-
[ ![Download](https://api.bintray.com/packages/mayconcardoso/ArchitectureBoilerplateGenerator/com.mctech.architecture.generator/images/download.svg?version=2.0.0) ](https://bintray.com/mayconcardoso/ArchitectureBoilerplateGenerator/com.mctech.architecture.generator/2.0.0/link)
4+
[ ![Download](https://api.bintray.com/packages/mayconcardoso/ArchitectureBoilerplateGenerator/io.github.mayconcardoso.boilerplate.generator/images/download.svg?version=2.0.0) ](https://bintray.com/mayconcardoso/ArchitectureBoilerplateGenerator/io.github.mayconcardoso.boilerplate.generator/2.0.0/link)
55

66
Recently I started off working for Unicred Mobile Banking as a Senior Android Engineer.
77

build.gradle

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1+
// Setup SDK versions.
2+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
3+
apply from: "$rootDir/buildSrc/setup.gradle"
4+
apply from: "$rootDir/buildSrc/publish-root.gradle"
5+
16
buildscript {
2-
ext.kotlin_version = '1.3.61'
37
repositories {
8+
maven { url = uri("https://plugins.gradle.org/m2/") }
49
google()
5-
jcenter()
6-
10+
mavenCentral()
711
}
12+
813
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.5.3'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
classpath "com.android.tools.build:gradle:7.4.2"
15+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"
16+
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
1117
}
1218
}
1319

1420
allprojects {
1521
repositories {
1622
google()
17-
jcenter()
18-
23+
mavenCentral()
1924
}
2025
}
2126

27+
// Setup subprojects dependencies
28+
apply from: "$rootDir/buildSrc/subprojects.gradle"
29+
2230
task clean(type: Delete) {
2331
delete rootProject.buildDir
24-
}
25-
26-
subprojects{
27-
tasks.withType(Javadoc).all {
28-
enabled = false
29-
}
3032
}

buildSrc/publish-module.gradle

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
4+
ext {
5+
PUBLISH_GROUP_ID = 'io.github.mayconcardoso'
6+
PUBLISH_VERSION = '3.0.0'
7+
}
8+
9+
task androidSourcesJar(type: Jar) {
10+
archiveClassifier.set('sources')
11+
if (project.plugins.findPlugin("com.android.library")) {
12+
// For android libraries
13+
from android.sourceSets.main.java.srcDirs
14+
from android.sourceSets.main.kotlin.srcDirs
15+
} else {
16+
// For pure kotlin libraries, in case you have them
17+
from sourceSets.main.java.srcDirs
18+
from sourceSets.main.kotlin.srcDirs
19+
}
20+
}
21+
artifacts {
22+
archives androidSourcesJar
23+
}
24+
25+
26+
group = PUBLISH_GROUP_ID
27+
version = PUBLISH_VERSION
28+
29+
afterEvaluate {
30+
publishing {
31+
publications {
32+
release(MavenPublication) {
33+
groupId PUBLISH_GROUP_ID
34+
artifactId PUBLISH_ARTIFACT_ID
35+
version PUBLISH_VERSION
36+
37+
if (project.plugins.findPlugin("com.android.library")) {
38+
from components.release
39+
} else {
40+
from components.java
41+
}
42+
43+
artifact androidSourcesJar
44+
45+
pom {
46+
name = PUBLISH_ARTIFACT_ID
47+
description = "This is only a personal implementation of MVVM architecture that makes your life easier by helping you to keep your screen components independently. It also has a concept of \"interaction\" defining exactly what the user can do on your screen turning the testing process extremely easier, once now you are able to test the \"state\" of your app."
48+
url = 'https://github.com/MayconCardoso/Mvvm-Architecture-Toolkit'
49+
licenses {
50+
license {
51+
name = 'MIT license'
52+
url = 'https://opensource.org/licenses/MIT'
53+
}
54+
}
55+
developers {
56+
developer {
57+
id = 'MayconCardoso'
58+
name = 'Maycon Cardoso'
59+
email = 'maycon.santos.cardoso@gmail.com'
60+
}
61+
}
62+
63+
// Version control info
64+
scm {
65+
connection = 'scm:git:github.com/MayconCardoso/Mvvm-Architecture-Toolkit.git'
66+
developerConnection = 'scm:git:ssh://github.com/MayconCardoso/Mvvm-Architecture-Toolkit.git'
67+
url = 'https://github.com/MayconCardoso/Mvvm-Architecture-Toolkit/tree/master'
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}
74+
signing {
75+
useGpgCmd()
76+
sign publishing.publications
77+
}

buildSrc/publish-root.gradle

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Create variables with empty default values
2+
ext["ossrhUsername"] = ''
3+
ext["ossrhPassword"] = ''
4+
ext["sonatypeStagingProfileId"] = ''
5+
ext["signing.keyId"] = ''
6+
ext["signing.password"] = ''
7+
ext["signing.key"] = ''
8+
9+
File secretPropsFile = project.rootProject.file('local.properties')
10+
if (secretPropsFile.exists()) {
11+
// Read local.properties file first if it exists
12+
Properties p = new Properties()
13+
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
14+
p.each { name, value -> ext[name] = value }
15+
} else {
16+
// Use system environment variables
17+
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
18+
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
19+
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
20+
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
21+
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
22+
ext["signing.key"] = System.getenv('SIGNING_KEY')
23+
}
24+
25+
// Set up Sonatype repository
26+
nexusPublishing {
27+
repositories {
28+
sonatype {
29+
stagingProfileId = sonatypeStagingProfileId
30+
username = ossrhUsername
31+
password = ossrhPassword
32+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
33+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
34+
}
35+
}
36+
}

buildSrc/setup.gradle

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Defines SDK variables.
2+
ext.targets = [
3+
minSdk : 21,
4+
compileSdk : 33,
5+
targetSdk : 33,
6+
kotlinJvmTarget : 11,
7+
]
8+
9+
// Defines Library variables.
10+
ext.versions = [
11+
'kotlin' : '1.8.10',
12+
]

buildSrc/subprojects.gradle

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
subprojects {
2+
afterEvaluate { project ->
3+
if (project.hasProperty('android')) {
4+
android {
5+
compileSdkVersion targets.compileSdk
6+
defaultConfig {
7+
minSdkVersion targets.minSdk
8+
targetSdkVersion targets.targetSdk
9+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
10+
}
11+
}
12+
}
13+
}
14+
}

gradle.properties

+7-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1-
# Project-wide Gradle settings.
2-
# IDE (e.g. Android Studio) users:
3-
# Gradle settings configured through the IDE *will override*
4-
# any settings specified in this file.
5-
# For more details on how to configure your build environment visit
6-
# http://www.gradle.org/docs/current/userguide/build_environment.html
7-
# Specifies the JVM arguments used for the daemon process.
8-
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx1536m
10-
# When configured, Gradle will run in incubating parallel mode.
11-
# This option should only be used with decoupled projects. More details, visit
12-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13-
# org.gradle.parallel=true
14-
# AndroidX package structure to make it clearer which packages are bundled with the
15-
# Android operating system, and which are packaged with your app's APK
16-
# https://developer.android.com/topic/libraries/support-library/androidx-rn
17-
android.useAndroidX=true
18-
# Automatically convert third-party libraries to use AndroidX
19-
android.enableJetifier=true
20-
# Kotlin code style for this project: "official" or "obsolete":
211
kotlin.code.style=official
2+
android.useAndroidX=true
3+
android.nonTransitiveRClass=true
4+
org.gradle.jvmargs=-Xmx6g -XX:MaxPermSize=6g -XX:+UseParallelGC
5+
org.gradle.parallel=true
6+
org.gradle.vfs.watch=true
7+
org.gradle.caching=false
8+
org.gradle.unsafe.configuration-cache=false
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Nov 27 21:35:59 BRST 2019
1+
#Mon Mar 27 10:33:51 BST 2023
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

library/.gitignore

-1
This file was deleted.

library/build.gradle

+5-67
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,13 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
4-
apply plugin: 'com.github.dcendents.android-maven'
5-
apply plugin: 'com.jfrog.bintray'
6-
7-
buildscript {
8-
repositories {
9-
jcenter()
10-
}
11-
dependencies {
12-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
13-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
14-
}
15-
}
16-
17-
18-
dependencies {
19-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61"
20-
testImplementation 'junit:junit:4.12'
21-
}
3+
apply plugin: 'kotlin-kapt'
224

235
ext {
24-
bintrayRepo = 'ArchitectureBoilerplateGenerator'
25-
bintrayName = 'com.mctech.architecture.generator'
26-
27-
publishedGroupId = 'com.mctech.architecture'
28-
libraryName = 'ArchitectureBoilerplateGenerator'
29-
artifact = 'generator'
30-
31-
libraryDescription = 'This is an auto-generator architecture file.'
32-
33-
siteUrl = 'https://github.com/MayconCardoso/ArchitectureBoilerplateGenerator'
34-
gitUrl = 'https://github.com/MayconCardoso/ArchitectureBoilerplateGenerator.git'
35-
36-
libraryVersion = '2.0.0'
37-
38-
developerId = 'mayconcardoso'
39-
developerName = 'Maycon Cardoso'
40-
developerEmail = 'maycon.santos.cardoso@gmail.com'
41-
42-
licenseName = 'The Apache Software License, Version 2.0'
43-
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
44-
allLicenses = ["Apache-2.0"]
6+
PUBLISH_ARTIFACT_ID = 'boilerplate-generator'
457
}
468

47-
ext.versions = [
48-
'minSdk' : 14,
49-
'compileSdk' : 29,
50-
'targetSdk' : 29,
51-
'buildTools' : '29.0.0',
52-
53-
'release' : libraryVersion,
54-
'code' : 18,
55-
]
56-
57-
android {
58-
compileSdkVersion versions.compileSdk
59-
buildToolsVersion versions.buildTools
9+
apply from: "$rootDir/buildSrc/publish-module.gradle"
6010

61-
defaultConfig {
62-
minSdkVersion versions.minSdk
63-
targetSdkVersion versions.targetSdk
64-
65-
versionCode versions.code
66-
versionName versions.release
67-
}
68-
69-
compileOptions {
70-
sourceCompatibility JavaVersion.VERSION_1_8
71-
targetCompatibility JavaVersion.VERSION_1_8
72-
}
11+
dependencies {
12+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
7313
}
74-
75-
apply from: 'https://raw.githubusercontent.com/LissF/JCenter/master/script.gradle'

library/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<manifest package="com.mctech.architecture.generator" />
1+
<manifest package="io.github.mayconcardoso.boilerplate.generator" />

library/src/main/java/com/mctech/architecture/generator/alias/LibraryAlias.kt

-54
This file was deleted.

0 commit comments

Comments
 (0)