Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
70530cd1
authored
Apr 04, 2019
by
toxicbakery
Committed by
Ian Thomas
Apr 08, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
#5731 Add license information to generated POM files
parent
9dc22c30
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
build.gradle
publish.gradle
build.gradle
View file @
70530cd1
...
...
@@ -44,6 +44,7 @@ allprojects {
}
buildDir
=
"${externalBuildDir}/${project.name}"
}
group
=
'com.google.android.exoplayer'
}
apply
from:
'javadoc_combined.gradle'
publish.gradle
View file @
70530cd1
...
...
@@ -23,6 +23,20 @@ if (project.ext.has("exoplayerPublishEnabled")
groupId
=
'com.google.android.exoplayer'
website
=
'https://github.com/google/ExoPlayer'
}
gradle
.
taskGraph
.
whenReady
{
taskGraph
->
project
.
tasks
.
findAll
{
task
->
task
.
name
.
contains
(
"generatePomFileFor"
)
}
.
forEach
{
task
->
task
.
doLast
{
task
.
outputs
.
files
.
filter
{
File
file
->
file
.
path
.
contains
(
"publications"
)
&&
file
.
name
.
matches
(
"^pom-.+\\.xml\$"
)
}
.
forEach
{
File
file
->
addLicense
(
file
)
}
}
}
}
}
def
getBintrayRepo
()
{
...
...
@@ -30,3 +44,21 @@ def getBintrayRepo() {
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
))
def
printer
=
new
XmlNodePrinter
(
writer
)
printer
.
preserveWhitespace
=
true
printer
.
print
(
xml
)
writer
.
close
()
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment