diff --git a/build.gradle b/build.gradle index e94849fbf1..fabac36293 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.3.0' - classpath 'com.novoda:bintray-release:0.3.4' + classpath 'com.novoda:bintray-release:0.4.0' } } @@ -34,10 +34,16 @@ allprojects { compileSdkVersion=25 targetSdkVersion=25 buildToolsVersion='25' - releaseRepoName = 'exoplayer' + releaseRepoName = getBintrayRepo() releaseUserOrg = 'google' releaseGroupId = 'com.google.android.exoplayer' releaseVersion = 'r2.2.0' releaseWebsite = 'https://github.com/google/ExoPlayer' } } + +def getBintrayRepo() { + boolean publicRepo = hasProperty('publicRepo') && + property('publicRepo').toBoolean() + return publicRepo ? 'exoplayer' : 'exoplayer-test' +} diff --git a/extensions/gvr/build.gradle b/extensions/gvr/build.gradle index 320397656e..5156cf0540 100644 --- a/extensions/gvr/build.gradle +++ b/extensions/gvr/build.gradle @@ -27,3 +27,9 @@ dependencies { compile project(':library') compile 'com.google.vr:sdk-audio:1.30.0' } + +ext { + releaseArtifact = 'extension-gvr' + releaseDescription = 'Google VR extension for ExoPlayer.' +} +apply from: '../../publish.gradle' diff --git a/extensions/okhttp/build.gradle b/extensions/okhttp/build.gradle index 8fc4d08ae3..3a2daefb8f 100644 --- a/extensions/okhttp/build.gradle +++ b/extensions/okhttp/build.gradle @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. apply plugin: 'com.android.library' -apply plugin: 'bintray-release' android { compileSdkVersion project.ext.compileSdkVersion @@ -36,12 +35,8 @@ dependencies { } } -publish { - artifactId = 'extension-okhttp' - description = 'An OkHttp extension for ExoPlayer.' - repoName = releaseRepoName - userOrg = releaseUserOrg - groupId = releaseGroupId - version = releaseVersion - website = releaseWebsite +ext { + releaseArtifact = 'extension-okhttp' + releaseDescription = 'OkHttp extension for ExoPlayer.' } +apply from: '../../publish.gradle' diff --git a/library/build.gradle b/library/build.gradle index 0ad54aadb2..abca404cfa 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -14,7 +14,6 @@ import com.android.builder.core.BuilderConstants apply plugin: 'com.android.library' -apply plugin: 'bintray-release' android { compileSdkVersion project.ext.compileSdkVersion @@ -81,12 +80,8 @@ android.libraryVariants.all { variant -> } } -publish { - artifactId = 'exoplayer' - description = 'The ExoPlayer library.' - repoName = releaseRepoName - userOrg = releaseUserOrg - groupId = releaseGroupId - version = releaseVersion - website = releaseWebsite +ext { + releaseArtifact = 'exoplayer' + releaseDescription = 'The ExoPlayer library.' } +apply from: '../publish.gradle' diff --git a/publish.gradle b/publish.gradle new file mode 100644 index 0000000000..17214959ab --- /dev/null +++ b/publish.gradle @@ -0,0 +1,24 @@ +// Copyright (C) 2017 The Android Open Source Project +// +// 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: 'bintray-release' + +publish { + artifactId = releaseArtifact + description = releaseDescription + repoName = releaseRepoName + userOrg = releaseUserOrg + groupId = releaseGroupId + version = releaseVersion + website = releaseWebsite +}