Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
quangctkm9207 committed Feb 18, 2017
0 parents commit 86a4260
Show file tree
Hide file tree
Showing 11 changed files with 773 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Store my configuration files which are used across projects

##Common
##Android
##iOS
##Windows
55 changes: 55 additions & 0 deletions android/android.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# 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
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries

# Keystore files
*.jks

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

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

# Freeline
freeline.py
freeline/
freeline_project_description.json
44 changes: 44 additions & 0 deletions android/gradle/app-build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apply plugin: 'com.android.application'

//Version information
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0

ext{
MIN_SDK = 14
TARGET_SDK = 25
BUILD_TOOLS = "25.0.2"
GOOGLE_LIBS = "25.1.0"
VERSION_CODE = versionMajor * 10000 + versionMinor * 100 + versionPatch
VERSION_NAME = "${versionMajor}.${versionMinor}.${versionPatch}"
}

android {
compileSdkVersion TARGET_SDK
buildToolsVersion BUILD_TOOLS

defaultConfig {
applicationId "com.quangnguyen.sample-app"
minSdkVersion MIN_SDK
targetSdkVersion TARGET_SDK
versionCode VERSION_CODE
versionName VERSION_NAME
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:$GOOGLE_LIBS"
compile "com.android.support:support-v4:$GOOGLE_LIBS"

//Other dependences
//.....
}
68 changes: 68 additions & 0 deletions android/gradle/bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apply plugin: 'com.jfrog.bintray'

version = libraryVersion

/*
* Uncomment this one if you want to include source code and distribute to jcenter
*
* In some case, you only want to distribute .aar files
* (For example, your source code is obfuscated by Proguard and dont)
* Without source code .jar files, you only can publish on bintray respository
* To distribute on jcenter, you need source code included
*/

//if (project.hasProperty("android")) { // Android libraries
// task sourcesJar(type: Jar) {
// classifier = 'sources'
// from android.sourceSets.main.java.srcDirs
// }
//
// task javadoc(type: Javadoc) {
// source = android.sourceSets.main.java.srcDirs
// classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
// }
//} else { // Java libraries
// task sourcesJar(type: Jar, dependsOn: classes) {
// classifier = 'sources'
// from sourceSets.main.allSource
// }
//}
//
//task javadocJar(type: Jar, dependsOn: javadoc) {
// classifier = 'javadoc'
// from javadoc.destinationDir
//}
//
//artifacts {
// archives javadocJar
// archives sourcesJar
//}

// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
//Optional. The passphrase for GPG signing'
}
}
}
}
41 changes: 41 additions & 0 deletions android/gradle/install.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apply plugin: 'com.github.dcendents.android-maven'

group = publishedGroupId // Maven Group ID for the artifact

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom.project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact

// Add your description here
name libraryName
description libraryDescription
url siteUrl

// Set your license
licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl

}
}

}
}
93 changes: 93 additions & 0 deletions android/gradle/library-build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apply plugin: 'com.android.library'

// Manifest version information
def versionMajor = 0
def versionMinor = 0
def versionPatch = 1

/**
* jcenter configuration
*/
ext {

//For bintray and jcenter distribution
bintrayRepo = 'maven'
bintrayName = 'sample-library'

publishedGroupId = 'com.quangnguyen.sample'
libraryName = 'SampleLibrary'
artifact = 'sample-library' //This artifact name should be the same with library module name

libraryDescription = 'Simple, clean and short description'

siteUrl = 'https://github.com/quangctkm9207/sample-library'
gitUrl = 'https://github.com/quangctkm9207/sample-library.git'

libraryVersion = "${versionMajor}.${versionMinor}.${versionPatch}"

developerId = 'quangctkm9207'
developerName = 'Quang Nguyen'
developerEmail = '[email protected]'

licenseName = 'The Apache Software License, Version 2.0' //Example for license
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]

//Project variable definition
MIN_SDK = 14
TARGET_SDK = 25
BUILD_TOOLS = "25.0.2"
GOOGLE_LIBS = "25.1.0"
VERSION_CODE = versionMajor * 10000 + versionMinor * 100 + versionPatch
VERSION_NAME = "${versionMajor}.${versionMinor}.${versionPatch}"

}

buildscript {
repositories {
//....
}

dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

//Others
//.....
}
}

/**
* Project configuration
*/

android {
compileSdkVersion TARGET_SDK
buildToolsVersion BUILD_TOOLS

defaultConfig {
minSdkVersion MIN_SDK
targetSdkVersion TARGET_SDK
versionCode VERSION_CODE
versionName VERSION_NAME

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

}

dependencies {
//......
}

//use gradle distribution configuration file on remote Github repository
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/install.gradle'
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/bintray.gradle'
Loading

0 comments on commit 86a4260

Please sign in to comment.