This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support for x86 emulator * Fixed MacOS issue with abis * Fix version code error
- Loading branch information
1 parent
2b8f04b
commit 82a2d0b
Showing
9 changed files
with
110 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,45 @@ | ||
import java.util.regex.Matcher | ||
import java.util.regex.Pattern | ||
|
||
configurations.maybeCreate('default') | ||
|
||
if (gradle.hasProperty('geckoViewLocal')) { | ||
def aar = new File(gradle.geckoViewLocal) | ||
def getCurrentFlavor() { | ||
Gradle gradle = getGradle() | ||
String taskReqStr = gradle.getStartParameter().getTaskRequests().toString() | ||
Pattern pattern | ||
if (taskReqStr.contains("assemble")) { | ||
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)") | ||
} else { | ||
pattern = Pattern.compile("generate(\\w+)(Release|Debug)") | ||
} | ||
Matcher matcher = pattern.matcher(taskReqStr) | ||
if (matcher.find()) { | ||
String flavor = matcher.group(1) | ||
// This makes first character to lowercase. | ||
char[] c = flavor.toCharArray() | ||
c[0] = Character.toLowerCase(c[0]) | ||
flavor = new String(c) | ||
println "getCurrentFlavor:" + flavor | ||
return flavor | ||
} else { | ||
println "getCurrentFlavor:cannot_find_current_flavor" | ||
return "" | ||
} | ||
} | ||
|
||
def addArtifact(path) { | ||
def aar = new File(path) | ||
if (aar.exists()) { | ||
artifacts.add('default', aar) | ||
} else { | ||
throw new GradleException('Failed to find GeckoView AAR at: ' + gradle.geckoViewLocal) | ||
} | ||
} else { | ||
throw new GradleException('Local GeckoView AAR path not defined') | ||
} | ||
|
||
def flavor = getCurrentFlavor() | ||
if (flavor.contains("Arm") && gradle.hasProperty('geckoViewLocalArm')) { | ||
addArtifact(gradle.geckoViewLocalArm) | ||
|
||
} else if (flavor.contains("X86") && gradle.hasProperty('geckoViewLocalX86')) { | ||
addArtifact(gradle.geckoViewLocalX86) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters