Open juhwan-jeong-hub opened 2 years ago
+1
i think this rules do not support other languages then java/scala - this should be mentioned in the readme
can you file a PR to add support for it?
this works perfectly
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_openapi//openapi:openapi.bzl", "openapi_gen")
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
openapi_gen(
name = "revenuecat_openapi_v1",
additional_properties = {
"packageName": "revenuecat",
"hideGenerationTimestamp": "true",
"withGoMod": "false",
},
language = "go",
spec = "@com_revenuecat_openapi_v1//file",
)
genrule(
name = "revenuecat_openapi_v1_unzip",
srcs = [":revenuecat_openapi_v1"],
outs = [
"unzip/api_customers.go",
"unzip/api_entitlements.go",
"unzip/api_offerings.go",
"unzip/api_transactions.go",
"unzip/client.go",
"unzip/configuration.go",
"unzip/model_defer_a_google_subscription_request.go",
"unzip/model_delete_subscriber_200_response.go",
"unzip/model_error.go",
"unzip/model_get_offerings_403_response.go",
"unzip/model_grant_a_promotional_entitlement_request.go",
"unzip/model_offerings.go",
"unzip/model_offerings_offerings_inner.go",
"unzip/model_offerings_offerings_inner_packages_inner.go",
"unzip/model_receipts_request.go",
"unzip/model_receipts_request_attributes_value.go",
"unzip/model_subscriber.go",
"unzip/model_subscriber_subscriber.go",
"unzip/model_subscriber_subscriber_entitlements_value.go",
"unzip/model_subscriber_subscriber_non_subscriptions_value_inner.go",
"unzip/model_subscriber_subscriber_subscriber_attributes_value.go",
"unzip/model_subscriber_subscriber_subscriptions_value.go",
"unzip/model_subscribersattribution_request.go",
"unzip/model_subscribersattribution_request_data.go",
"unzip/model_update_subscriber_attributes_400_response.go",
"unzip/model_update_subscriber_attributes_400_response_attribute_errors_inner.go",
"unzip/model_update_subscriber_attributes_request.go",
"unzip/model_update_subscriber_attributes_request_attributes.go",
"unzip/model_update_subscriber_attributes_request_attributes_key_name.go",
"unzip/response.go",
"unzip/utils.go",
],
cmd = "unzip $(location :revenuecat_openapi_v1) -d $(@D)/unzip",
)
write_source_files(
name = "revenuecat_openapi_v1_source",
diff_test = True,
files = {
"api_customers.go": "//revenuecat/v1:unzip/api_customers.go",
"api_entitlements.go": "//revenuecat/v1:unzip/api_entitlements.go",
"api_offerings.go": "//revenuecat/v1:unzip/api_offerings.go",
"api_transactions.go": "//revenuecat/v1:unzip/api_transactions.go",
"client.go": "//revenuecat/v1:unzip/client.go",
"configuration.go": "//revenuecat/v1:unzip/configuration.go",
"model_defer_a_google_subscription_request.go": "//revenuecat/v1:unzip/model_defer_a_google_subscription_request.go",
"model_delete_subscriber_200_response.go": "//revenuecat/v1:unzip/model_delete_subscriber_200_response.go",
"model_error.go": "//revenuecat/v1:unzip/model_error.go",
"model_get_offerings_403_response.go": "//revenuecat/v1:unzip/model_get_offerings_403_response.go",
"model_grant_a_promotional_entitlement_request.go": "//revenuecat/v1:unzip/model_grant_a_promotional_entitlement_request.go",
"model_offerings.go": "//revenuecat/v1:unzip/model_offerings.go",
"model_offerings_offerings_inner.go": "//revenuecat/v1:unzip/model_offerings_offerings_inner.go",
"model_offerings_offerings_inner_packages_inner.go": "//revenuecat/v1:unzip/model_offerings_offerings_inner_packages_inner.go",
"model_receipts_request.go": "//revenuecat/v1:unzip/model_receipts_request.go",
"model_receipts_request_attributes_value.go": "//revenuecat/v1:unzip/model_receipts_request_attributes_value.go",
"model_subscriber.go": "//revenuecat/v1:unzip/model_subscriber.go",
"model_subscriber_subscriber.go": "//revenuecat/v1:unzip/model_subscriber_subscriber.go",
"model_subscriber_subscriber_entitlements_value.go": "//revenuecat/v1:unzip/model_subscriber_subscriber_entitlements_value.go",
"model_subscriber_subscriber_non_subscriptions_value_inner.go": "//revenuecat/v1:unzip/model_subscriber_subscriber_non_subscriptions_value_inner.go",
"model_subscriber_subscriber_subscriber_attributes_value.go": "//revenuecat/v1:unzip/model_subscriber_subscriber_subscriber_attributes_value.go",
"model_subscriber_subscriber_subscriptions_value.go": "//revenuecat/v1:unzip/model_subscriber_subscriber_subscriptions_value.go",
"model_subscribersattribution_request.go": "//revenuecat/v1:unzip/model_subscribersattribution_request.go",
"model_subscribersattribution_request_data.go": "//revenuecat/v1:unzip/model_subscribersattribution_request_data.go",
"model_update_subscriber_attributes_400_response.go": "//revenuecat/v1:unzip/model_update_subscriber_attributes_400_response.go",
"model_update_subscriber_attributes_400_response_attribute_errors_inner.go": "//revenuecat/v1:unzip/model_update_subscriber_attributes_400_response_attribute_errors_inner.go",
"model_update_subscriber_attributes_request.go": "//revenuecat/v1:unzip/model_update_subscriber_attributes_request.go",
"model_update_subscriber_attributes_request_attributes.go": "//revenuecat/v1:unzip/model_update_subscriber_attributes_request_attributes.go",
"model_update_subscriber_attributes_request_attributes_key_name.go": "//revenuecat/v1:unzip/model_update_subscriber_attributes_request_attributes_key_name.go",
"response.go": "//revenuecat/v1:unzip/response.go",
"utils.go": "//revenuecat/v1:unzip/utils.go",
},
)
go_library(
name = "revenuecat",
srcs = [
"api_customers.go",
"api_entitlements.go",
"api_offerings.go",
"api_transactions.go",
"client.go",
"configuration.go",
"model_defer_a_google_subscription_request.go",
"model_delete_subscriber_200_response.go",
"model_error.go",
"model_get_offerings_403_response.go",
"model_grant_a_promotional_entitlement_request.go",
"model_offerings.go",
"model_offerings_offerings_inner.go",
"model_offerings_offerings_inner_packages_inner.go",
"model_receipts_request.go",
"model_receipts_request_attributes_value.go",
"model_subscriber.go",
"model_subscriber_subscriber.go",
"model_subscriber_subscriber_entitlements_value.go",
"model_subscriber_subscriber_non_subscriptions_value_inner.go",
"model_subscriber_subscriber_subscriber_attributes_value.go",
"model_subscriber_subscriber_subscriptions_value.go",
"model_subscribersattribution_request.go",
"model_subscribersattribution_request_data.go",
"model_update_subscriber_attributes_400_response.go",
"model_update_subscriber_attributes_400_response_attribute_errors_inner.go",
"model_update_subscriber_attributes_request.go",
"model_update_subscriber_attributes_request_attributes.go",
"model_update_subscriber_attributes_request_attributes_key_name.go",
"response.go",
"utils.go",
],
importpath = "github.com/mindful-hq/earth-payment-revenuecat-openapi/revenuecat/v1",
visibility = ["//visibility:public"],
)
I have the following code:
If I build
sample-go-src
, I can see that it builds successfully and outputs a.srcjar
file.However, if I build
sample-go
, I get the below error:Consequently, I cannot declare dependency on the
go_library
to use in my Go code.