-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf8aca2
commit 00b1a40
Showing
10 changed files
with
154 additions
and
75 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from bazelrio_gentool.deps.sha256_helper import get_hash | ||
|
||
|
||
def get_toolchain_dependencies(): | ||
class PlatformConfig: | ||
def __init__(self, repo_os, platforms_os, strip_prefix, suffix): | ||
self.repo_os = repo_os | ||
self.platforms_os = platforms_os | ||
self.strip_prefix = strip_prefix | ||
self.suffix = suffix | ||
|
||
def get_sha256(self): | ||
return get_hash(self.get_url(), fail_on_miss=True) | ||
|
||
def get_url(self): | ||
return f"https://github.com/adoptium/temurin17-binaries/releases/download/jdk-{escaped_version}/OpenJDK17U-jdk_x64_{self.repo_os}_hotspot_{underscore_version}.{self.suffix}" | ||
|
||
platforms = [] | ||
|
||
jdk_version = "17.0.8+7" | ||
underscore_version = jdk_version.replace("+", "_") | ||
escaped_version = jdk_version.replace("+", "%2B") | ||
|
||
platforms.append( | ||
PlatformConfig( | ||
repo_os="linux", | ||
platforms_os="linux", | ||
strip_prefix="jdk-" + jdk_version, | ||
suffix="tar.gz", | ||
) | ||
) | ||
platforms.append( | ||
PlatformConfig( | ||
repo_os="mac", | ||
platforms_os="macos", | ||
strip_prefix="jdk-" + jdk_version + "/Contents/Home", | ||
suffix="tar.gz", | ||
) | ||
) | ||
platforms.append( | ||
PlatformConfig( | ||
repo_os="windows", | ||
platforms_os="windows", | ||
strip_prefix="jdk-" + jdk_version, | ||
suffix="zip", | ||
) | ||
) | ||
|
||
output = dict( | ||
repo_name="rules_bzlmodrio_jdk", | ||
platforms=platforms, | ||
jdk_version=jdk_version, | ||
escaped_version=escaped_version, | ||
underscore_version=underscore_version, | ||
jre_version=17, | ||
) | ||
|
||
return output |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
|
||
def main(): | ||
raise | ||
print(get_toolchain_dependencies()["jdk_version"]) | ||
|
||
|
||
if __name__ == "__main__": | ||
|
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
Oops, something went wrong.