-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: copy some aspect files to the client side to prepare for templ…
…ating (#6842) * [maintenance] copy java_info.bzl to project side to prepare for templating it. * rename local path * refactor a few files that use `override_repository` * abc * abc * revert change * revert changes * fix error for clion * attempt to fix aspect test * update clwb BUILD file + fix ijwb visibility typo * updated logic * disable tests * update logic * mute tests
- Loading branch information
1 parent
26e7bc1
commit 893eaa8
Showing
29 changed files
with
607 additions
and
306 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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 was deleted.
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,33 @@ | ||
filegroup( | ||
name = "aspect_files", | ||
srcs = [ | ||
"WORKSPACE", | ||
"BUILD.bazel", | ||
"java_info.bzl", | ||
"java_info.template.bzl", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
genrule( | ||
name = "generate_java_info_template", | ||
outs = ["java_info.template.bzl"], | ||
srcs = ["java_info.bzl"], | ||
cmd = "cat $(SRCS) >$@ && " + | ||
"sed -i -e '/TEMPLATE-IGNORE-BEGIN/,/TEMPLATE-IGNORE-END/d' $@ && " + | ||
"sed -i -e '/TEMPLATE-INCLUDE-BEGIN/,/TEMPLATE-INCLUDE-END/{s/^[#][#]//;}' $@", | ||
) | ||
|
||
genrule( | ||
name = "rename_files", | ||
srcs = ["BUILD.aspect"], | ||
outs = ["BUILD.bazel"], | ||
cmd = "cp $< $@", | ||
) | ||
|
||
genrule( | ||
name = "create_workspace_file", | ||
outs = ["WORKSPACE"], | ||
srcs = [], | ||
cmd = r"""echo 'workspace(name = "intellij_aspect_template")' > $@""" | ||
) |
Empty file.
Empty file.
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,50 @@ | ||
# TEMPLATE-INCLUDE-BEGIN | ||
###if( $isJavaEnabled == "true" && $bazel8OrAbove == "true" ) | ||
##load("@rules_java//java/common:java_info.bzl", "JavaInfo") | ||
###end | ||
# TEMPLATE-INCLUDE-END | ||
|
||
def java_info_in_target(target): | ||
# TEMPLATE-IGNORE-BEGIN | ||
return JavaInfo in target | ||
# TEMPLATE-IGNORE-END | ||
|
||
# TEMPLATE-INCLUDE-BEGIN | ||
## #if( $isJavaEnabled == "true" ) | ||
## return JavaInfo in target | ||
## #else | ||
## return None | ||
## #end | ||
# TEMPLATE-INCLUDE-END | ||
|
||
def get_java_info(target): | ||
# TEMPLATE-IGNORE-BEGIN | ||
if JavaInfo in target: | ||
return target[JavaInfo] | ||
else: | ||
return None | ||
# TEMPLATE-IGNORE-END | ||
|
||
# TEMPLATE-INCLUDE-BEGIN | ||
## #if( $isJavaEnabled == "true" ) | ||
## if JavaInfo in target: | ||
## return target[JavaInfo] | ||
## else: | ||
## return None | ||
## #else | ||
## return None | ||
## #end | ||
# TEMPLATE-INCLUDE-END | ||
|
||
def java_info_reference(): | ||
# TEMPLATE-IGNORE-BEGIN | ||
return [JavaInfo] | ||
# TEMPLATE-IGNORE-END | ||
|
||
# TEMPLATE-INCLUDE-BEGIN | ||
## #if( $isJavaEnabled == "true" ) | ||
## return [JavaInfo] | ||
## #else | ||
## return [] | ||
## #end | ||
# TEMPLATE-INCLUDE-END |
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
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.