Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ local.properties
.idea/workspace.xml
.idea/libraries
.idea/misc.xml
*.iml
*.iml
.idea
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
31 changes: 27 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

GROUP=com.liulishuo.engzo
VERSION_NAME=1.3.0-rc.0

POM_ARTIFACT_ID=lingo-recorder
POM_NAME=LingoRecorder
POM_DESCRIPTION=LingoRecorder
POM_PACKAGING=aar

POM_URL=https://git.llsapp.com/android-hub/lingoRecorder
ISSUE_URL=https://git.llsapp.com/android-hub/lingoRecorder/issues
POM_SCM_URL=https://git.llsapp.com/android-hub/lingoRecorder
POM_SCM_CONNECTION=scm:git:git://git.llsapp.com/android-hub/lingoRecorder.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git.llsapp.com/android-hub/lingoRecorder.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=lingochamp
POM_DEVELOPER_NAME=LingoChamp, Inc.

LLS_RELEASE_REPOSITORY_URL=http://m2.llsapp.com/repository/releases/
LLS_SNAPSHOT_REPOSITORY_URL=http://m2.llsapp.com/repository/snapshots/

org.gradle.parallel=true
235 changes: 235 additions & 0 deletions gradle/mvn-push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
/*
* Copyright 2013 Chris Banes
*
* 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'
apply from: '../gradle/mvn-pushlocal.gradle'

version = VERSION_NAME
group = GROUP

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

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

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

def getRepositoryUsername() {
File localFile = rootProject.file("local.properties")
if (localFile.exists()) {
Properties properties = new Properties()
properties.load(localFile.newDataInputStream())
if (properties.getProperty('username') != null) return properties.getProperty('username')
}

return hasProperty('LLS_RELEASE_REPOSITORY_URL') ? (hasProperty('LLS_M2_USER') ? LLS_M2_USER : ""):
(hasProperty('SONATYPE_NEXUS_USERNAME') ? SONATYPE_NEXUS_USERNAME : "")
}

def getRepositoryPassword() {
File localFile = rootProject.file("local.properties")
if (localFile.exists()) {
Properties properties = new Properties()
properties.load(localFile.newDataInputStream())
if (properties.getProperty('password') != null) return properties.getProperty('password')
}

return hasProperty('LLS_RELEASE_REPOSITORY_URL')? (hasProperty('LLS_M2_PASSWORD') ? LLS_M2_PASSWORD : "") :
(hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : "")
}

afterEvaluate { project ->
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
}

if (project.getPlugins().hasPlugin('com.android.application') ||
project.getPlugins().hasPlugin('com.android.library')) {
task install(type: Upload, dependsOn: assemble) {
repositories.mavenInstaller {
configuration = configurations.archives

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

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
}
}
}
}
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.source
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.source
}
} else {
install {
repositories.mavenInstaller {
pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME

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
}
}
}
}
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
}

if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

artifacts {
if (project.getPlugins().hasPlugin('com.android.application') ||
project.getPlugins().hasPlugin('com.android.library')) {
archives androidSourcesJar
archives androidJavadocsJar
} else {
archives sourcesJar
archives javadocJar
}
}
}
48 changes: 48 additions & 0 deletions gradle/mvn-pushlocal.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2018 LingoChamp Inc.
*
* 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-publish'

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "source"
}

publishing {
publications {
logx(MavenPublication) {
groupId GROUP
artifactId POM_ARTIFACT_ID
version VERSION_NAME
artifact(sourceJar)
artifact("$buildDir/outputs/aar/${project.name}-release.aar")

pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each {
if (it.group != null
&& (it.name != null || "unspecified" == it.name)
&& it.version != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
14 changes: 8 additions & 6 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.lingochamp'

ext {
PUBLISH_GROUP_ID = 'com.liulishuo.engzo'
group = 'com.liulishuo.engzo'
version = '1.3.0-rc.0'
PUBLISH_ARTIFACT_ID = 'lingo-recorder'
PUBLISH_VERSION = '1.2.5'
}

android {
Expand Down Expand Up @@ -42,4 +39,9 @@ dependencies {
compile 'com.android.support:support-annotations:25.3.0'
}

apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
apply from: rootProject.file('gradle/mvn-push.gradle')

tasks.withType(Javadoc).all {
enabled = false
}

Loading