Skip to content

Commit

Permalink
Publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Pomepuy committed Apr 13, 2021
1 parent 6a5af92 commit 2cd00b6
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 75 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ buildscript {
flatDir dirs: "gradle/plugins"
google()
jcenter()
}
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:$android_plugin_version"
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'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
}
}

Expand Down
2 changes: 1 addition & 1 deletion buildsystem/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ fi

if [ ! -d "gradle/wrapper" ]; then
diagnostic "Downloading gradle"
GRADLE_VERSION=6.5
GRADLE_VERSION=6.6
GRADLE_URL=https://download.videolan.org/pub/contrib/gradle/gradle-${GRADLE_VERSION}-bin.zip
wget ${GRADLE_URL} 2>/dev/null || curl -O ${GRADLE_URL} || fail "gradle: download failed"

Expand Down
8 changes: 6 additions & 2 deletions buildsystem/gitlab/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cache:
- gradle-5.4.1/
- gradle-6.1.1/
- gradle-6.5/
- gradle-6.6/
- gradle/
- gradlew

Expand Down Expand Up @@ -153,15 +154,18 @@ publish_libs:
- if: '$CI_COMMIT_TAG =~ /^libvlc-.*$/'
variables:
ARCH: all
M2_REPO: "$CI_PROJECT_DIR/aars/repository"
script:
- mkdir -p $M2_REPO
- ./buildsystem/compile.sh -l -a ${ARCH} release
- GRADLE_ABI=ALL ./gradlew -p libvlc bintrayupload
- GRADLE_ABI=ALL RELEASE_SIGNING_ENABLED=false ./gradlew -Dmaven.repo.local=$M2_REPO -p libvlc publishToMavenLocal
- ./buildsystem/compile.sh -ml -a ${ARCH} release
- GRADLE_ABI=ALL ./gradlew -p medialibrary bintrayupload
- GRADLE_ABI=ALL RELEASE_SIGNING_ENABLED=false ./gradlew -Dmaven.repo.local=$M2_REPO -p medialibrary publishToMavenLocal
artifacts:
name: "${CI_COMMIT_TAG}.dbg"
paths:
- .dbg/
- $M2_REPO
expire_in: 2 weeks

release:
Expand Down
62 changes: 1 addition & 61 deletions buildsystem/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,64 +28,4 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
artifacts {
archives javadocJar
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 '[email protected]'
}
}
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 = System.getenv('K8S_SECRET_BINTRAY_USER') ?: properties.getProperty("bintray.user")
key = System.getenv('K8S_SECRET_BINTRAY_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
override = true
publicDownloadNumbers = true
version {
desc = libraryDescription
}
}
publish = true
}
}
13 changes: 13 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,16 @@ kapt.use.worker.api=true
kapt.include.compile.classpath=false
org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true

POM_URL=https://code.videolan.org/videolan/vlc-android/
POM_SCM_URL=https://code.videolan.org/videolan/vlc-android/
POM_SCM_CONNECTION=scm:git:https://code.videolan.org/videolan/vlc-android.git
POM_SCM_DEV_CONNECTION=scm:git:https://code.videolan.org/videolan/vlc-android.git

POM_LICENCE_NAME=GNU Lesser General Public License, version 2.1
POM_LICENCE_URL=https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=videolan
POM_DEVELOPER_NAME=VideoLAN
POM_DEVELOPER_URL=https://www.videolan.org/
10 changes: 5 additions & 5 deletions libvlc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.vanniktech.maven.publish"

def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
def vlcSrcDirs = System.getenv('GRADLE_VLC_SRC_DIRS')
ext {
library_version = "$rootProject.ext.libvlcVersion"
repoName = 'Android'
libraryName = 'LibVLC-Android'
lib_artifact = "libvlc-$abi"

libraryDescription = 'Android bindings and API for VLC'
}
android {

Expand Down Expand Up @@ -108,4 +104,8 @@ def vlcRevision() {
return vlc.toString()
}

mavenPublish {
releaseSigningEnabled = false
}

apply from: '../buildsystem/publish.gradle'
31 changes: 31 additions & 0 deletions libvlc/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# *************************************************************************
# gradle.properties
# **************************************************************************
# Copyright © 2021 VLC authors and VideoLAN
# Author: Nicolas POMEPUY
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
# ***************************************************************************
#
#
#

GROUP=org.videolan.android
POM_ARTIFACT_ID=libvlc-all


POM_NAME=LibVLC-Android
POM_DESCRIPTION=Android bindings and API for VLC
POM_INCEPTION_YEAR=2021
10 changes: 5 additions & 5 deletions medialibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@
*/
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.vanniktech.maven.publish"

def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
ext {
library_version = "$rootProject.ext.medialibraryVersion"
repoName = 'Android'
libraryName = 'Medialibrary-Android'
lib_artifact = "medialibrary-$abi"

libraryDescription = 'Android bindings and API for Medialibrary'
}
android {
compileOptions {
Expand Down Expand Up @@ -107,4 +103,8 @@ dependencies {

}

mavenPublish {
releaseSigningEnabled = false
}

apply from: '../buildsystem/publish.gradle'
31 changes: 31 additions & 0 deletions medialibrary/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# *************************************************************************
# gradle.properties
# **************************************************************************
# Copyright © 2021 VLC authors and VideoLAN
# Author: Nicolas POMEPUY
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
# ***************************************************************************
#
#
#

GROUP=org.videolan.android
POM_ARTIFACT_ID=medialibrary-all


POM_NAME=Medialibrary-Android
POM_DESCRIPTION=Android bindings and API for Medialibrary
POM_INCEPTION_YEAR=2021

0 comments on commit 2cd00b6

Please sign in to comment.