mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix publishing to bintray
The configuration to publish to Maven seems to be incompatible with the configuration for bintray, so only enable one at once. Once the GMaven publishing flow is completely set up we can remove the exoplayerPublishEnabled constant and the first branch entirely. Issue: #5246 PiperOrigin-RevId: 359056610
This commit is contained in:
parent
cad2c50c34
commit
e8b4986640
@ -12,10 +12,9 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// For publishing to Bintray.
|
|
||||||
|
|
||||||
if (project.ext.has("exoplayerPublishEnabled")
|
if (project.ext.has("exoplayerPublishEnabled")
|
||||||
&& project.ext.exoplayerPublishEnabled) {
|
&& project.ext.exoplayerPublishEnabled) {
|
||||||
|
// For publishing to Bintray.
|
||||||
apply plugin: 'bintray-release'
|
apply plugin: 'bintray-release'
|
||||||
publish {
|
publish {
|
||||||
artifactId = releaseArtifact
|
artifactId = releaseArtifact
|
||||||
@ -41,42 +40,8 @@ if (project.ext.has("exoplayerPublishEnabled")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
def getBintrayRepo() {
|
|
||||||
boolean publicRepo = hasProperty('publicRepo') &&
|
|
||||||
property('publicRepo').toBoolean()
|
|
||||||
return publicRepo ? 'exoplayer' : 'exoplayer-test'
|
|
||||||
}
|
|
||||||
|
|
||||||
static void addLicense(File pom) {
|
|
||||||
def licenseNode = new Node(null, "license")
|
|
||||||
licenseNode.append(
|
|
||||||
new Node(null, "name", "The Apache Software License, Version 2.0"))
|
|
||||||
licenseNode.append(
|
|
||||||
new Node(null, "url", "http://www.apache.org/licenses/LICENSE-2.0.txt"))
|
|
||||||
licenseNode.append(new Node(null, "distribution", "repo"))
|
|
||||||
def licensesNode = new Node(null, "licenses")
|
|
||||||
licensesNode.append(licenseNode)
|
|
||||||
|
|
||||||
def xml = new XmlParser().parse(pom)
|
|
||||||
xml.append(licensesNode)
|
|
||||||
|
|
||||||
def writer = new PrintWriter(new FileWriter(pom))
|
|
||||||
writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
|
|
||||||
def printer = new XmlNodePrinter(writer)
|
|
||||||
printer.preserveWhitespace = true
|
|
||||||
printer.print(xml)
|
|
||||||
writer.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
// For publishing to a Maven repository.
|
// For publishing to a Maven repository.
|
||||||
|
|
||||||
task androidSourcesJar(type: Jar) {
|
|
||||||
archiveClassifier.set('sources')
|
|
||||||
from android.sourceSets.main.java.srcDirs
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
publishing {
|
publishing {
|
||||||
@ -116,3 +81,36 @@ afterEvaluate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def getBintrayRepo() {
|
||||||
|
boolean publicRepo = hasProperty('publicRepo') &&
|
||||||
|
property('publicRepo').toBoolean()
|
||||||
|
return publicRepo ? 'exoplayer' : 'exoplayer-test'
|
||||||
|
}
|
||||||
|
|
||||||
|
static void addLicense(File pom) {
|
||||||
|
def licenseNode = new Node(null, "license")
|
||||||
|
licenseNode.append(
|
||||||
|
new Node(null, "name", "The Apache Software License, Version 2.0"))
|
||||||
|
licenseNode.append(
|
||||||
|
new Node(null, "url", "http://www.apache.org/licenses/LICENSE-2.0.txt"))
|
||||||
|
licenseNode.append(new Node(null, "distribution", "repo"))
|
||||||
|
def licensesNode = new Node(null, "licenses")
|
||||||
|
licensesNode.append(licenseNode)
|
||||||
|
|
||||||
|
def xml = new XmlParser().parse(pom)
|
||||||
|
xml.append(licensesNode)
|
||||||
|
|
||||||
|
def writer = new PrintWriter(new FileWriter(pom))
|
||||||
|
writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
|
||||||
|
def printer = new XmlNodePrinter(writer)
|
||||||
|
printer.preserveWhitespace = true
|
||||||
|
printer.print(xml)
|
||||||
|
writer.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
task androidSourcesJar(type: Jar) {
|
||||||
|
archiveClassifier.set('sources')
|
||||||
|
from android.sourceSets.main.java.srcDirs
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user