Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask_android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Akuma
bitmask_android
Commits
c7800673
Commit
c7800673
authored
5 years ago
by
cyberta
Browse files
Options
Downloads
Patches
Plain Diff
remove unnecessary check for unchanged default app names and application Id's in build.gradle
parent
afea1bfb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/build.gradle
+0
-39
0 additions, 39 deletions
app/build.gradle
with
0 additions
and
39 deletions
app/build.gradle
+
0
−
39
View file @
c7800673
import
java.util.concurrent.ExecutionException
import
java.util.regex.Matcher
import
java.util.regex.Pattern
...
...
@@ -427,41 +426,3 @@ def getCurrentFlavorForBetaOrRelease() {
return
""
;
}
}
\ No newline at end of file
def
getCurrentFlavor
()
{
Gradle
gradle
=
getGradle
()
String
tskReqStr
=
gradle
.
getStartParameter
().
getTaskRequests
().
toString
()
Pattern
pattern
;
if
(
tskReqStr
.
contains
(
"assemble"
))
pattern
=
Pattern
.
compile
(
"assemble(\\w+)(Beta|Release|Debug)"
)
else
pattern
=
Pattern
.
compile
(
"generate(\\w+)(Beta|Release|Debug)"
)
Matcher
matcher
=
pattern
.
matcher
(
tskReqStr
)
if
(
matcher
.
find
())
return
matcher
.
group
(
1
).
toLowerCase
()
else
{
return
""
;
}
}
task
checkApplicationIdForCustomFlavor
(
type:
Exec
)
{
def
currFlavor
=
getCurrentFlavor
()
if
(
currFlavor
.
contains
(
"custom"
))
{
android
.
applicationVariants
.
all
{
variant
->
def
mergedFlavor
=
variant
.
mergedFlavor
if
(
variant
.
flavorName
.
toString
().
equalsIgnoreCase
(
currFlavor
)
&&
mergedFlavor
.
getApplicationId
().
equalsIgnoreCase
(
"org.sample.custom"
))
throw
new
ExecutionException
(
"ERROR: please change the applicationId(org.sample.custom) if you want to build a custom branded app!"
)
}
}
}
task
checkAppNameForCustomFlavor
(
type:
Exec
)
{
def
currFlavor
=
getCurrentFlavor
()
if
(
currFlavor
.
contains
(
"custom"
)
&&
appName
.
equalsIgnoreCase
(
"custom"
))
throw
new
ExecutionException
(
"ERROR: please change the appName(Custom) if you want to build a custom branded app!"
)
}
\ No newline at end of file
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