Skip to content

Commit

Permalink
Merge pull request #68 from zeoflow/buildsrc-folder
Browse files Browse the repository at this point in the history
Created `buildSrc` folder
  • Loading branch information
teogor authored Apr 20, 2021
2 parents 6ee8160 + 80ba790 commit f002611
Show file tree
Hide file tree
Showing 10 changed files with 355 additions and 134 deletions.
88 changes: 79 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,81 @@
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
/.idea
# Built application files
*.apk
*.aar
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
flow-kit/flow-kit.gpg

# Idea Folder
.idea/*
# Include dictionary
!.idea/dictionaries
# Include code-style
!.idea/codeStyles

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
*.jks
*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
134 changes: 134 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/dictionaries/defualt.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ ext {
minSdkVersion = 21
targetSdkVersion = 30
versionCode = 1
versionName = "1.5.1"
versionName = "1.5.2"
}
5 changes: 5 additions & 0 deletions buildSrc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SIGNING KEYS
*.gpg

# Key Credentials
gradle.properties
105 changes: 105 additions & 0 deletions buildSrc/upload.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
* Copyright (C) 2021 ZeoFlow S.R.L.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'maven'
apply plugin: 'signing'

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getSnapshotRepositoryUrl() {
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
: "https://oss.sonatype.org/content/repositories/snapshots/"
}

def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

afterEvaluate { project ->
project.generateDebugBuildConfig.enabled = false
project.generateReleaseBuildConfig.enabled = false
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME

repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}

artifacts {
archives androidSourcesJar
}
}
2 changes: 1 addition & 1 deletion flow-kit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies {

}

apply from: "${rootProject.projectDir}/flow-kit/maven-push.gradle"
apply from: "${rootProject.projectDir}/buildSrc/upload.gradle"
repositories {
mavenCentral()
}
21 changes: 3 additions & 18 deletions flow-kit/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
POM_NAME=FlowKit
POM_ARTIFACT_ID=flow-kit
POM_PACKAGING=aar
VERSION_NAME=1.5.1
GROUP=com.zeoflow
POM_DESCRIPTION=An Android Library that comes with useful features and components
POM_URL=https://github.com/zeoflow/flow-kit
POM_SCM_URL=https://github.com/zeoflow/flow-kit
POM_SCM_CONNECTION=scm:git@github.com:zeoflow/flow-kit.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:zeoflow/flow-kit.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=zeoflow
POM_DEVELOPER_NAME=ZeoFlow
org.gradle.daemon=true
NEXUS_USERNAME=
NEXUS_PASSWORD=
# artifact id
# com.zeoflow:flow-kit
POM_ARTIFACT_ID=flow-kit
Loading

0 comments on commit f002611

Please sign in to comment.