mirror of
https://github.com/mik3y/usb-serial-for-android.git
synced 2026-08-11 08:22:52 +00:00
build with jitpack
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'signing'
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
@@ -28,81 +26,7 @@ dependencies {
|
||||
androidTestImplementation 'org.apache.commons:commons-lang3:3.8.1'
|
||||
}
|
||||
|
||||
group = "com.hoho.android"
|
||||
version = "0.2.0-SNAPSHOT"
|
||||
// to build a .jar file use gradle task 'createFullJarRelease'
|
||||
|
||||
configurations {
|
||||
archives {
|
||||
extendsFrom configurations.default
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
|
||||
sign configurations.archives
|
||||
}
|
||||
|
||||
def getRepositoryUsername() {
|
||||
return hasProperty('sonatypeUsername') ? sonatypeUsername : ""
|
||||
}
|
||||
|
||||
def getRepositoryPassword() {
|
||||
return hasProperty('sonatypePassword') ? sonatypePassword : ""
|
||||
}
|
||||
|
||||
def isReleaseBuild() {
|
||||
return version.contains("SNAPSHOT") == false
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
def sonatypeRepositoryUrl
|
||||
if (isReleaseBuild()) {
|
||||
println 'RELEASE BUILD'
|
||||
sonatypeRepositoryUrl = hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
|
||||
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
|
||||
} else {
|
||||
println 'SNAPSHOT BUILD'
|
||||
sonatypeRepositoryUrl = hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
|
||||
: "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
|
||||
configuration = configurations.archives
|
||||
repositories.mavenDeployer {
|
||||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
||||
|
||||
repository(url: sonatypeRepositoryUrl) {
|
||||
authentication(userName: getRepositoryUsername(),
|
||||
password: getRepositoryPassword())
|
||||
}
|
||||
|
||||
pom.artifactId = 'usb-serial-for-android'
|
||||
pom.project {
|
||||
name 'usb-serial-for-android'
|
||||
packaging 'aar'
|
||||
description 'USB Serial Driver Library for Android'
|
||||
url 'https://github.com/mik3y/usb-serial-for-android'
|
||||
|
||||
scm {
|
||||
url 'scm:git@github.com:mik3y/usb-serial-for-android.git'
|
||||
connection 'scm:git@github.com:mik3y/usb-serial-for-android.git'
|
||||
developerConnection 'scm:git@github.com:mik3y/usb-serial-for-android.git'
|
||||
}
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name 'GNU LGPL v2.1'
|
||||
url 'http://www.gnu.org/licenses/lgpl-2.1.txt'
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id 'mik3y'
|
||||
name 'mik3y'
|
||||
email 'opensource@hoho.com'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// to deploy into local maven repository use gradle task 'publishToMavenLocal' and enable:
|
||||
//apply from: 'publishToMavenLocal.gradle'
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
groupId 'com.github.mik3y'
|
||||
artifactId 'usb-serial-for-android'
|
||||
version '1.x.0'
|
||||
afterEvaluate {
|
||||
artifact androidSourcesJar
|
||||
artifact bundleReleaseAar
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task androidSourcesJar(type: Jar) {
|
||||
classifier 'sources'
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.hoho.android.usbserial"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
package="com.hoho.android.usbserial">
|
||||
</manifest>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.hoho.android.usbserial;
|
||||
|
||||
/**
|
||||
* Static container of information about this library.
|
||||
*/
|
||||
public final class BuildInfo {
|
||||
|
||||
/**
|
||||
* The current version of this library. Values are of the form
|
||||
* "major.minor.micro[-suffix]". A suffix of "-pre" indicates a pre-release
|
||||
* of the version preceeding it.
|
||||
*/
|
||||
public static final String VERSION = "0.2.0-pre";
|
||||
|
||||
private BuildInfo() {
|
||||
throw new IllegalStateException("Non-instantiable class.");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user