Commit 0e445db0 authored by Geoffrey Métais's avatar Geoffrey Métais

Bintray setup

parent 2b2888ca
......@@ -23,7 +23,16 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
ext {
library_version = '0.1'
repoName = 'LibVLC'
libraryName = 'VLC-API'
desc = 'SDK for VLC-Android extensions'
lib_artifact = 'vlc-extensions'
libraryDescription = 'SDK for VLC-Android extensions'
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
......@@ -41,110 +50,10 @@ android {
}
}
task generateSources (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))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api "androidx.appcompat:appcompat:$rootProject.ext.androidxVersion"
testImplementation "junit:junit:$rootProject.ext.junitVersion"
}
def properties = new Properties()
properties.load( new FileInputStream("local.properties"))
group = properties.getProperty("package.groupId")
version = properties.getProperty("version.name")
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
groupId properties.getProperty("package.groupId")
artifactId properties.getProperty("package.name")
name properties.getProperty("package.name")
description properties.getProperty("package.description")
url properties.getProperty("package.url")
licenses {
license {
name properties.getProperty("license.name")
url properties.getProperty("license.url")
}
}
developers {
developer {
id properties.getProperty("developer.id")
name properties.getProperty("developer.name")
email properties.getProperty("developer.email")
}
}
scm {
connection properties.getProperty("vcs.connection")
developerConnection properties.getProperty("vcs.connection")
url properties.getProperty("vcs.url")
}
}
}
}
}
artifacts {
archives javadocJar
archives generateSources
}
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = properties.getProperty("package.repository")
name = properties.getProperty("package.name")
//userOrg = properties.getProperty("package.groupId")
desc = properties.getProperty("package.description")
websiteUrl = properties.getProperty("package.url")
vcsUrl = properties.getProperty("vcs.url")
licenses = [properties.getProperty("package.licenses")]
publish = true
publicDownloadNumbers = true
version {
name = properties.getProperty("version.name")
desc = properties.getProperty("version.description")
released = new Date()
vcsTag = properties.getProperty("vcs.tag")
//gpg {
// sign = true
// passphrase = properties.getProperty("bintray.gpg.password")
//}
//mavenCentralSync {
// sync = true
// user = properties.getProperty("bintray.user") //OSS user token: mandatory
// password = properties.getProperty("bintray.password") //OSS user password: mandatory
// close = '1'
//}
}
}
}
// launch uploadApi to upload extension api on bintray based on values in local.properties
task uploadApi {
dependsOn 'install'
dependsOn 'bintrayUpload'
tasks.findByName('bintrayUpload').mustRunAfter 'install'
}
\ No newline at end of file
apply from: '../publish.gradle'
......@@ -10,9 +10,9 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:$android_plugin_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
......
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
ext {
library_version = '3.1.0'
repoName = 'LibVLC'
libraryName = 'LibVLC-Android'
lib_artifact = "libvlc-$abi"
libraryDescription = 'Android bindings and API for VLC'
}
android {
defaultConfig {
......@@ -9,17 +19,17 @@ android {
}
sourceSets {
main {
jni.srcDirs = [] // Prevent gradle from building native code with ndk; we have our own Makefile for it.
jniLibs.srcDirs = [ 'jni/libs' ] // Where generated .so files are placed.
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets' ]
}
main {
jni.srcDirs = [] // Prevent gradle from building native code with ndk; we have our own Makefile for it.
jniLibs.srcDirs = [ 'jni/libs' ] // Where generated .so files are placed.
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets' ]
}
}
buildTypes {
......@@ -49,50 +59,61 @@ android {
// packageTask.include(['**/gdbserver', '**/gdb.setup'])
//}
class BuildNative extends Exec {}
tasks.withType(BuildNative){
/*
Properties set for Android Studio own shell.
when you run gradlew from cli, OS shell env variables will be used
To be able to build from Android Studio, you have to set ndk.dir & sdk.dir
properties in local.properties in the root folder, like this (for example):
sdk.dir=/home/<username>/SDK/android-sdk-linux
ndk.dir=/home/<username>/SDK/android-ndk-r10b
*/
if (System.getenv('ANDROID_SDK') == null || System.getenv('ANDROID_NDK') == null) {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
environment 'ANDROID_NDK', properties.getProperty('ndk.dir')
environment 'ANDROID_SDK', properties.getProperty('sdk.dir')
}
workingDir '..'
commandLine './compile-libvlc.sh'
//class BuildNative extends Exec {}
//
//tasks.withType(BuildNative){
// /*
// Properties set for Android Studio own shell.
// when you run gradlew from cli, OS shell env variables will be used
//
// To be able to build from Android Studio, you have to set ndk.dir & sdk.dir
// properties in local.properties in the root folder, like this (for example):
// sdk.dir=/home/<username>/SDK/android-sdk-linux
// ndk.dir=/home/<username>/SDK/android-ndk-r10b
// */
// if (System.getenv('ANDROID_SDK') == null || System.getenv('ANDROID_NDK') == null) {
// Properties properties = new Properties()
// properties.load(project.rootProject.file('local.properties').newDataInputStream())
// environment 'ANDROID_NDK', properties.getProperty('ndk.dir')
// environment 'ANDROID_SDK', properties.getProperty('sdk.dir')
// }
// workingDir '..'
// commandLine './compile-libvlc.sh'
//}
//
//task buildDebugARMv7(type:BuildNative) {
// args('-a', "armeabi-v7a")
//}
//task buildDebugARM64(type:BuildNative) {
// args('-a', "arm64-v8a")
//}
//task buildDebugx86(type:BuildNative) {
// args('-a', "x86")
//}
//task buildDebugx86_64(type:BuildNative) {
// args('-a', "x86_64")
//}
//task buildDebugMIPS(type:BuildNative) {
// args('-a', "mips")
//}
//task buildDebugMIPS64(type:BuildNative) {
// args('-a', "mips64")
//}
//
task generateSources (type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
task buildDebugARMv7(type:BuildNative) {
args('-a', "armeabi-v7a")
}
task buildDebugARM64(type:BuildNative) {
args('-a', "arm64-v8a")
}
task buildDebugx86(type:BuildNative) {
args('-a', "x86")
}
task buildDebugx86_64(type:BuildNative) {
args('-a', "x86_64")
}
task buildDebugMIPS(type:BuildNative) {
args('-a', "mips")
}
task buildDebugMIPS64(type:BuildNative) {
args('-a', "mips64")
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
failOnError false
}
task generateSources (type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
clean {
......@@ -103,3 +124,10 @@ dependencies {
api "androidx.annotation:annotation:$rootProject.ext.androidxVersion"
api "androidx.legacy:legacy-support-v4:$rootProject.ext.androidxVersion"
}
artifacts {
archives javadocJar
archives generateSources
}
apply from: '../publish.gradle'
......@@ -21,6 +21,17 @@
* ***************************************************************************
*/
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
ext {
library_version = '0.4'
repoName = 'LibVLC'
libraryName = 'Medialibrary-Android'
lib_artifact = "medialibrary-$abi"
libraryDescription = 'Android bindings and API for Medialibrary'
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
......@@ -78,4 +89,6 @@ dependencies {
api "androidx.fragment:fragment:$rootProject.ext.androidxVersion"
testImplementation "junit:junit:$rootProject.ext.junitVersion"
implementation project(':tools')
}
\ No newline at end of file
}
apply from: '../publish.gradle'
apply plugin: 'com.github.dcendents.android-maven'
group = 'org.videolan.android'
version = library_version
def siteUrl = 'https://code.videolan.org/videolan/vlc-android/'
def gitUrl = 'https://code.videolan.org/videolan/vlc-android.git'
def licenseName = 'GNU Lesser General Public License, version 2.1'
def licenseUrl = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html'
def allLicenses = ["LGPL-2.1"]
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
install {
group = 'publishing'
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom.project {
packaging 'aar'
artifactId lib_artifact
name repoName
description libraryDescription
url 'https://code.videolan.org/videolan/vlc-android/'
licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id 'videolan'
name 'VideoLAN'
email 'android@videolan.org'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
apply plugin: 'com.jfrog.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 = repoName
name = libraryName
desc = libraryDescription
websiteUrl = siteUrl
issueTrackerUrl = 'https://code.videolan.org/videolan/vlc-android/issues'
licenses = allLicenses
vcsUrl = gitUrl
labels = ['aar', 'android', 'vlc']
dryRun = false
publish = true
override = false
publicDownloadNumbers = true
version {
desc = libraryDescription
}
}
// publish = true
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment