Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xnat-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dhcp
xnat-web
Commits
9c2a13fa
Commit
9c2a13fa
authored
9 years ago
by
Rick Herrick
Browse files
Options
Downloads
Patches
Plain Diff
Added propertyWithDefault() helper function to work with builds without deploy and repo vars set.
parent
264df418
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.gradle
+16
-12
16 additions, 12 deletions
build.gradle
with
16 additions
and
12 deletions
build.gradle
+
16
−
12
View file @
9c2a13fa
...
...
@@ -290,19 +290,19 @@ dependencies {
}
cargo
{
def
blankProperty
=
"xxx"
def
blankPort
=
0
// These properties must be set in the ~/.gradle/gradle.properties file or passed on the Gradle command line in
// the form -PdeployPort=8080 -PdeployContext=/ -PdeployHost=localhost -PdeployUser=deploy -PdeployPassword=deploy
containerId
=
'tomcat7x'
port
=
hasP
roperty
(
'deployPort'
)
?
getProperty
(
'deployPort'
)
as
int
:
blankPort
port
=
p
roperty
WithDefault
(
'deployPort'
,
8080
)
as
int
deployable
{
context
=
hasP
roperty
(
'deployContext'
)
?
getProperty
(
'deployContext'
)
:
blankProperty
context
=
p
roperty
WithDefault
(
'deployContext'
,
'/'
)
}
remote
{
hostname
=
hasP
roperty
(
'deployHost'
)
?
getProperty
(
'deployHost'
)
:
blankProperty
username
=
hasP
roperty
(
'deployUser'
)
?
getProperty
(
'deployUser'
)
:
blankProperty
password
=
hasP
roperty
(
'deployPassword'
)
?
getProperty
(
'deployPassword'
)
:
blankProperty
hostname
=
p
roperty
WithDefault
(
'deployHost'
,
'localhost'
)
username
=
p
roperty
WithDefault
(
'deployUser'
,
'deploy'
)
password
=
p
roperty
WithDefault
(
'deployPassword'
,
'deploy'
)
}
}
...
...
@@ -341,9 +341,9 @@ publishing {
maven
{
credentials
{
// These properties must be set in the ~/.gradle/gradle.properties file or passed on the Gradle command
// line in the form -
D
repoUsername=foo -
D
repoPassword=bar.
username
hasP
roperty
(
'repoUsername'
)
?
getProperty
(
'repoUsername'
)
:
blankProperty
password
hasP
roperty
(
'repoPassword'
)
?
getProperty
(
'repoPassword'
)
:
blankProperty
// line in the form -
P
repoUsername=foo -
P
repoPassword=bar.
username
p
roperty
WithDefault
(
'repoUsername'
,
'username'
)
password
p
roperty
WithDefault
(
'repoPassword'
,
'password'
)
}
if
(
project
.
version
.
endsWith
(
'-SNAPSHOT'
))
{
url
"http://nrgxnat.artifactoryonline.com/nrgxnat/libs-snapshot-local"
...
...
@@ -355,8 +355,8 @@ publishing {
credentials
{
// These properties must be set in the ~/.gradle/gradle.properties file or passed on the Gradle command
// line in the form -DrepoUsername=foo -DrepoPassword=bar.
username
hasP
roperty
(
'repoUsername'
)
?
getProperty
(
'repoUsername'
)
:
blankProperty
password
hasP
roperty
(
'repoPassword'
)
?
getProperty
(
'repoPassword'
)
:
blankProperty
username
p
roperty
WithDefault
(
'repoUsername'
,
'username'
)
password
p
roperty
WithDefault
(
'repoPassword'
,
'password'
)
}
if
(
project
.
version
.
endsWith
(
'-SNAPSHOT'
))
{
url
"http://nrgxnat.artifactoryonline.com/nrgxnat/libs-snapshot-local"
...
...
@@ -366,3 +366,7 @@ publishing {
}
}
}
def
propertyWithDefault
(
def
String
property
,
def
Object
value
)
{
hasProperty
(
property
)
?
getProperty
(
property
)
:
value
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment