Skip to content

Conversation

@sakanaou
Copy link

When I tried to use this package for my build setup at https://github.com/sakanaou/openapi-first I noticed it does not execute correctly on Windows:

C:\prj\openapi-first>bazel build --verbose_failures //backend-v1
INFO: Analyzed target //backend-v1:backend-v1 (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: C:/prj/openapi-first/backend-v1/BUILD.bazel:4:12: error executing shell command: 'C:/WINDOWS/system32/bash.exe -c mkdir -p backend-v1/openapi_backend_v1_gen && external/local_jdk/bin/java.exe -cp external/io_bazel_rules_openapi_org_openapitools_openapi_generator_cli/openapi-gene...' failed (Exit 1): bash.exe failed: error executing command
  cd C:/users/daing/_bazel_daing/j3rcz5bc/execroot/__main__
C:/WINDOWS/system32/bash.exe -c mkdir -p backend-v1/openapi_backend_v1_gen && external/local_jdk/bin/java.exe -cp external/io_bazel_rules_openapi_org_openapitools_openapi_generator_cli/openapi-generator-cli-4.3.1.jar: org.openapitools.codegen.OpenAPIGenerator generate -i backend-v1/api.yaml -g spring -o backend-v1/openapi_backend_v1_gen -D "" --additional-properties "delegatePattern=true" --type-mappings "" --api-package de.cegeka.jax.backend.v1.api --invoker-package de.cegeka.jax.backend.v1.server --model-package de.cegeka.jax.backend.v1.model 2>/dev/null && find backend-v1/openapi_backend_v1_gen -exec touch -t 198001010000 {} \; && external/local_jdk/bin/jar cMf bazel-out/x64_windows-fastbuild/bin/backend-v1/openapi_backend_v1_gen_codegen.srcjar -C backend-v1/openapi_backend_v1_gen .
Execution platform: @local_config_platform//:host
Target //backend-v1:backend-v1 failed to build
INFO: Elapsed time: 0.865s, Critical Path: 0.52s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

This is due to the fact, that the classpath separator is different there and the jar command must be called with the appropiate extension. I adjusted the relevant portions so the build works fine now.

chenrui333 added a commit that referenced this pull request Oct 26, 2020
@chenrui333
Copy link
Owner

I just added windows-latest to the CI, will merge this PR after the CI run. Thanks for your improvement, @sakanaou!

@chenrui333 chenrui333 changed the title Added support for building on Windows feat: added support for building on Windows Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants