From f59141f3190db84b9f085e5af4a91083887c2956 Mon Sep 17 00:00:00 2001 From: Bart Louwers Date: Thu, 31 Aug 2023 13:06:09 +0200 Subject: [PATCH] Drawable Renderer (#1570) --- .github/workflows/android-ci.yml | 3 +- .github/workflows/ios-ci.yml | 7 +- .github/workflows/linux-ci.yml | 10 +- .github/workflows/node-ci.yml | 3 +- .github/workflows/pr-size-test-result.yml | 5 +- BUILD.bazel | 55 ++-- WORKSPACE | 4 +- bazel/core.bzl | 6 +- include/mbgl/shaders/gl/drawable_line_sdf.hpp | 2 - platform/ios/BUILD.bazel | 276 ++---------------- scripts/generate-style-code.js | 45 +-- shaders/drawable.line_sdf.fragment.glsl | 1 - shaders/drawable.line_sdf.vertex.glsl | 1 - shaders/generate_shader_code.js | 12 +- 14 files changed, 72 insertions(+), 358 deletions(-) diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 4bb2d3c5a..986ea4bd9 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -26,8 +26,7 @@ on: - "!**/*.md" pull_request: branches: - - main - - topic/drawable + - '*' paths: - CMakeLists.txt - 'platform/android/**' diff --git a/.github/workflows/ios-ci.yml b/.github/workflows/ios-ci.yml index ffc3bce95..5eec81f15 100644 --- a/.github/workflows/ios-ci.yml +++ b/.github/workflows/ios-ci.yml @@ -32,8 +32,7 @@ on: pull_request: branches: - - main - - topic/drawable + - '*' paths: - CMakeLists.txt - 'platform/ios/**' @@ -142,10 +141,10 @@ jobs: run: bazel run //platform/ios:lint-plists - name: Running iOS tests - run: bazel test --//:renderer=${{ matrix.renderer }} //platform/ios/platform/ios/test:ios_test --test_output=errors + run: bazel test //platform/ios/test:ios_test --test_output=errors - name: Running iOS UI tests - run: bazel test --//:renderer=${{ matrix.renderer }} //platform/ios/platform/ios/iosapp-UITests:uitest --test_output=errors + run: bazel test //platform/ios/iosapp-UITests:uitest --test_output=errors # size test diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index dc2315d27..94679bea8 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -23,8 +23,7 @@ on: pull_request: branches: - - main - - topic/drawable + - '*' paths: - "src/**" - "test/**" @@ -232,8 +231,11 @@ jobs: - name: Generate coverage report run: | - bazel coverage --test_output=errors --combined_report=lcov --nobuild_runfile_links --local_test_jobs=1 --instrumentation_filter="//:mbgl-core" //test:core //render-test:render-test --//:maplibre_platform=linux --run_under=//platform/linux:startxwrapper - echo coverage_report=$(bazel info output_path)/_coverage/_coverage_report.dat >> $GITHUB_ENV + xvfb-run -a \ + bazel coverage --combined_report=lcov --instrumentation_filter="//:mbgl-core" --//:maplibre_platform=linux \ + --test_output=errors --local_test_jobs=1 \ + --test_env=DISPLAY --test_env=XAUTHORITY --copt="-DCI_BUILD" \ + //test:core //expression-test:test - name: Upload coverage report if: '!cancelled()' diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 8ffa15234..88e6059ad 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -33,8 +33,7 @@ on: pull_request: branches: - - main - - topic/drawable + - '*' paths: - CMakeLists.txt - "platform/linux/**" diff --git a/.github/workflows/pr-size-test-result.yml b/.github/workflows/pr-size-test-result.yml index ce120b80a..f718ca32f 100644 --- a/.github/workflows/pr-size-test-result.yml +++ b/.github/workflows/pr-size-test-result.yml @@ -12,10 +12,7 @@ jobs: steps: - uses: actions/checkout@v3 - # for debugging - - run: echo ${{ github.event }} - - - uses: .github/actions/download-workflow-run-artifact + - uses: ./.github/actions/download-workflow-run-artifact with: artifact-name: size-test-result expect-files: "./size" diff --git a/BUILD.bazel b/BUILD.bazel index 5362a9514..58f10a0b3 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -12,54 +12,41 @@ load( "MLN_OPENGL_SOURCE", "MLN_PRIVATE_GENERATED_STYLE_HEADERS", "MLN_PUBLIC_GENERATED_STYLE_HEADERS", - "MLN_PRIVATE_GENERATED_STYLE_HEADERS", - "MLN_GENERATED_STYLE_SOURCE", - "MLN_GENERATED_SHADER_HEADERS", - "MLN_CORE_SOURCE", - "MLN_CORE_HEADERS", - "MLN_OPENGL_SOURCE", - "MLN_OPENGL_HEADERS", - "MLN_DRAWABLES_SOURCE", - "MLN_DRAWABLES_HEADERS", ) -load("//bazel:macros.bzl", "appendList") # Generate code required by the core -# All generated code is placed in the prefix location __generated__ -# by our generator scripts and genrules -PREFIXED = { - "MLN_PUBLIC_GENERATED_STYLE_HEADERS": appendList(MLN_PUBLIC_GENERATED_STYLE_HEADERS, "__generated__/"), - "MLN_PRIVATE_GENERATED_STYLE_HEADERS": appendList(MLN_PRIVATE_GENERATED_STYLE_HEADERS, "__generated__/"), - "MLN_GENERATED_STYLE_SOURCE": appendList(MLN_GENERATED_STYLE_SOURCE, "__generated__/"), - "MLN_GENERATED_SHADER_HEADERS": appendList(MLN_GENERATED_SHADER_HEADERS, "__generated__/"), -} - filegroup( name = "style_data", - srcs = glob(["**/*.ejs"], allow_empty = False) + srcs = glob( + ["**/*.ejs"], + allow_empty = False, + ), ) genrule( name = "generated_style_code", + srcs = ["style_data"], + outs = MLN_PUBLIC_GENERATED_STYLE_HEADERS + + MLN_PRIVATE_GENERATED_STYLE_HEADERS + + MLN_GENERATED_STYLE_SOURCE, cmd = "node $(execpath scripts/generate-style-code.js) --root $(RULEDIR)", tools = ["scripts/generate-style-code.js"], - srcs = ["style_data"], - outs = PREFIXED["MLN_PUBLIC_GENERATED_STYLE_HEADERS"] - + PREFIXED["MLN_PRIVATE_GENERATED_STYLE_HEADERS"] - + PREFIXED["MLN_GENERATED_STYLE_SOURCE"], ) filegroup( name = "shader_data", - srcs = ["shaders/manifest.json"] + glob(["shaders/*.glsl"], allow_empty = False) + srcs = ["shaders/manifest.json"] + glob( + ["shaders/*.glsl"], + allow_empty = False, + ), ) genrule( name = "generated_shaders", + srcs = ["shader_data"], + outs = MLN_GENERATED_SHADER_HEADERS, cmd = "node $(execpath shaders/generate_shader_code.js) --root $(RULEDIR)", tools = ["shaders/generate_shader_code.js"], - srcs = ["shader_data"], - outs = PREFIXED["MLN_GENERATED_SHADER_HEADERS"], ) # This header only target strips the __generated__ prefix for the compiler @@ -67,13 +54,12 @@ genrule( cc_library( name = "mbgl-core-generated-public-artifacts", srcs = [], - hdrs = PREFIXED["MLN_PUBLIC_GENERATED_STYLE_HEADERS"] - + PREFIXED["MLN_GENERATED_SHADER_HEADERS"], - strip_include_prefix = "__generated__/include", + hdrs = MLN_PUBLIC_GENERATED_STYLE_HEADERS + + MLN_GENERATED_SHADER_HEADERS, visibility = ["//visibility:public"], deps = [ - ":generated_style_code", ":generated_shaders", + ":generated_style_code", ], ) @@ -81,8 +67,7 @@ cc_library( cc_library( name = "mbgl-core-generated-private-artifacts", srcs = [], - hdrs = PREFIXED["MLN_PRIVATE_GENERATED_STYLE_HEADERS"], - strip_include_prefix = "__generated__/src", + hdrs = MLN_PRIVATE_GENERATED_STYLE_HEADERS, visibility = ["//visibility:private"], deps = [ ":generated_style_code", @@ -123,7 +108,7 @@ cc_library( ], }) + select({ "//:ios": ["GLES_SILENCE_DEPRECATION=1"], - "//conditions:default": [] + "//conditions:default": [], }), includes = [ "include", @@ -134,8 +119,8 @@ cc_library( ], visibility = ["//visibility:public"], deps = [ - ":mbgl-core-generated-public-artifacts", ":mbgl-core-generated-private-artifacts", + ":mbgl-core-generated-public-artifacts", "//vendor:boost", "//vendor:csscolorparser", "//vendor:earcut.hpp", diff --git a/WORKSPACE b/WORKSPACE index 06455395c..0c6f92cf8 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -10,8 +10,8 @@ http_archive( http_archive( name = "rules_xcodeproj", - sha256 = "f836d2a516a911dc0ace44b1f51aa575613f149a934f4be1e7bd551a549672ff", - url = "https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/download/1.7.1/release.tar.gz", + sha256 = "5baccdd6a2734a0adeb9cb6175691d0609f8bdbd7c5f516e828d0df744ee9f6c", + url = "https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/download/1.9.1/release.tar.gz", ) load( diff --git a/bazel/core.bzl b/bazel/core.bzl index 71c3f3687..0559b7ad8 100644 --- a/bazel/core.bzl +++ b/bazel/core.bzl @@ -423,6 +423,7 @@ MLN_CORE_SOURCE = [ "src/mbgl/style/expression/match.cpp", "src/mbgl/style/expression/number_format.cpp", "src/mbgl/style/expression/parsing_context.cpp", + "src/mbgl/style/expression/slice.cpp", "src/mbgl/style/expression/step.cpp", "src/mbgl/style/expression/util.cpp", "src/mbgl/style/expression/util.hpp", @@ -627,7 +628,7 @@ MLN_CORE_SOURCE = [ "src/mbgl/util/utf.hpp", "src/mbgl/util/version.cpp", "src/mbgl/util/version.hpp", - "src/mbgl/util/work_request.cpp" + "src/mbgl/util/work_request.cpp", ] MLN_CORE_HEADERS = [ @@ -747,6 +748,7 @@ MLN_CORE_HEADERS = [ "include/mbgl/style/expression/match.hpp", "include/mbgl/style/expression/number_format.hpp", "include/mbgl/style/expression/parsing_context.hpp", + "include/mbgl/style/expression/slice.hpp", "include/mbgl/style/expression/step.hpp", "include/mbgl/style/expression/type.hpp", "include/mbgl/style/expression/value.hpp", @@ -820,7 +822,7 @@ MLN_CORE_HEADERS = [ "include/mbgl/util/vectors.hpp", "include/mbgl/util/work_request.hpp", "include/mbgl/util/work_task.hpp", - "include/mbgl/util/work_task_impl.hpp" + "include/mbgl/util/work_task_impl.hpp", ] MLN_OPENGL_SOURCE = [ diff --git a/include/mbgl/shaders/gl/drawable_line_sdf.hpp b/include/mbgl/shaders/gl/drawable_line_sdf.hpp index 37c641081..d36cbf1e5 100644 --- a/include/mbgl/shaders/gl/drawable_line_sdf.hpp +++ b/include/mbgl/shaders/gl/drawable_line_sdf.hpp @@ -56,7 +56,6 @@ layout (std140) uniform LineSDFInterpolationUBO { lowp float u_offset_t; lowp float u_width_t; lowp float u_floorwidth_t; - highp float pad2; }; @@ -216,7 +215,6 @@ layout (std140) uniform LineSDFInterpolationUBO { lowp float u_offset_t; lowp float u_width_t; lowp float u_floorwidth_t; - highp float pad2; }; diff --git a/platform/ios/BUILD.bazel b/platform/ios/BUILD.bazel index 66b0425de..972d6c0f0 100644 --- a/platform/ios/BUILD.bazel +++ b/platform/ios/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_xcframework", "apple_xcframework", "local_provisioning_profile") +load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_xcframework", "apple_xcframework") load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_framework") load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle") load( @@ -7,20 +7,18 @@ load( "xcodeproj", "xcode_schemes", ) -load("bazel/macros.bzl", "info_plist") -load("bazel/__generated__/provisioning_profile.bzl", "APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID", "APPLE_MOBILE_PROVISIONING_PROFILE_UUID") - -local_provisioning_profile( - name = "provisioning_profile", - profile_name = APPLE_MOBILE_PROVISIONING_PROFILE_UUID, - team_id = APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID -) - -xcode_provisioning_profile( - name = "xcode_profile", - managed_by_xcode = True, - provisioning_profile = ":provisioning_profile" +load("//platform/ios/bazel:macros.bzl", "info_plist") +load("//platform/ios/bazel:config.bzl", "BUILD_MODE", "BUNDLE_ID_PREFIX") +load( + "//platform/ios/bazel:files.bzl", + "MLN_IOS_PRIVATE_HEADERS", + "MLN_IOS_PUBLIC_HEADERS", + "MLN_IOS_PUBLIC_OBJCPP_SOURCE", + "MLN_IOS_PUBLIC_OBJC_SOURCE", + "MLN_IOS_SDK_HEADERS", + "MLN_PUBLIC_IOS_APP_SOPURCE", ) +load("//platform/ios/bazel:provisioning.bzl", "configure_device_profiles") configure_device_profiles() @@ -141,238 +139,7 @@ apple_resource_bundle( "resources/*.lproj/**", "resources/*.xcassets/**", ]), -) - -# Objcpp files for the iOS source -objc_library( - name = "objcpp-sdk", - srcs = [ - "platform/darwin/src/MLNAttributionInfo.mm", - "platform/darwin/src/MLNBackgroundStyleLayer.mm", - "platform/darwin/src/MLNCircleStyleLayer.mm", - "platform/darwin/src/MLNComputedShapeSource.mm", - "platform/darwin/src/MLNDefaultStyle.mm", - "platform/darwin/src/MLNFeature.mm", - "platform/darwin/src/MLNFillExtrusionStyleLayer.mm", - "platform/darwin/src/MLNFillStyleLayer.mm", - "platform/darwin/src/MLNForegroundStyleLayer.mm", - "platform/darwin/src/MLNFoundation.mm", - "platform/darwin/src/MLNGeometry.mm", - "platform/darwin/src/MLNHeatmapStyleLayer.mm", - "platform/darwin/src/MLNHillshadeStyleLayer.mm", - "platform/darwin/src/MLNImageSource.mm", - "platform/darwin/src/MLNLight.mm", - "platform/darwin/src/MLNLineStyleLayer.mm", - "platform/darwin/src/MLNLoggingConfiguration.mm", - "platform/darwin/src/MLNMapCamera.mm", - "platform/darwin/src/MLNMapSnapshotter.mm", - "platform/darwin/src/MLNMultiPoint.mm", - "platform/darwin/src/MLNNetworkConfiguration.mm", - "platform/darwin/src/MLNOfflinePack.mm", - "platform/darwin/src/MLNOfflineStorage.mm", - "platform/darwin/src/MLNOpenGLStyleLayer.mm", - "platform/darwin/src/MLNPointAnnotation.mm", - "platform/darwin/src/MLNPointCollection.mm", - "platform/darwin/src/MLNPolygon.mm", - "platform/darwin/src/MLNPolyline.mm", - "platform/darwin/src/MLNRasterDEMSource.mm", - "platform/darwin/src/MLNRasterStyleLayer.mm", - "platform/darwin/src/MLNRasterTileSource.mm", - "platform/darwin/src/MLNSettings.mm", - "platform/darwin/src/MLNShape.mm", - "platform/darwin/src/MLNShapeCollection.mm", - "platform/darwin/src/MLNShapeOfflineRegion.mm", - "platform/darwin/src/MLNShapeSource.mm", - "platform/darwin/src/MLNSource.mm", - "platform/darwin/src/MLNStyle.mm", - "platform/darwin/src/MLNStyleLayer.mm", - "platform/darwin/src/MLNStyleLayerManager.mm", - "platform/darwin/src/MLNStyleValue.mm", - "platform/darwin/src/MLNSymbolStyleLayer.mm", - "platform/darwin/src/MLNTilePyramidOfflineRegion.mm", - "platform/darwin/src/MLNTileServerOptions.mm", - "platform/darwin/src/MLNTileSource.mm", - "platform/darwin/src/MLNVectorStyleLayer.mm", - "platform/darwin/src/MLNVectorTileSource.mm", - "platform/darwin/src/NSArray+MLNAdditions.mm", - "platform/darwin/src/NSBundle+MLNAdditions.mm", - "platform/darwin/src/NSCoder+MLNAdditions.mm", - "platform/darwin/src/NSComparisonPredicate+MLNAdditions.mm", - "platform/darwin/src/NSCompoundPredicate+MLNAdditions.mm", - "platform/darwin/src/NSDate+MLNAdditions.mm", - "platform/darwin/src/NSDictionary+MLNAdditions.mm", - "platform/darwin/src/NSExpression+MLNAdditions.mm", - "platform/darwin/src/NSPredicate+MLNAdditions.mm", - "platform/darwin/src/NSValue+MLNStyleAttributeAdditions.mm", - "platform/ios/src/MLNAnnotationView.mm", - "platform/ios/src/MLNCompassButton.mm", - "platform/ios/src/MLNFaux3DUserLocationAnnotationView.mm", - "platform/ios/src/MLNMapAccessibilityElement.mm", - "platform/ios/src/MLNMapProjection.mm", - "platform/ios/src/MLNMapView.mm", - "platform/ios/src/MLNMapView+Impl.mm", - "platform/ios/src/MLNMapView+OpenGL.mm", - "platform/ios/src/MLNScaleBar.mm", - "platform/ios/src/UIColor+MLNAdditions.mm", - "platform/ios/src/UIImage+MLNAdditions.mm", - ], - copts = CPP_FLAGS + MAPLIBRE_FLAGS + [ - "-fcxx-modules", - "-fmodules", - "-Wno-c99-extensions", - "-Wno-gnu-zero-variadic-macro-arguments", - "-Wno-gnu-conditional-omitted-operand", - "-Wno-gnu-statement-expression", - ], - includes = [ - "platform/darwin/include", - ], - sdk_frameworks = [ - "CoreImage", - "CoreLocation", - "GLKit", - "OpenGLES", - "QuartzCore", - ], - defines = ["GLES_SILENCE_DEPRECATION=1"], - deps = [ - "objc-headers", - "//:mbgl-core", - "//platform/darwin:darwin-objcpp", - "//platform/default:mbgl-default", - "//platform/ios/platform/ios/vendor:SMCalloutView", - ], -) - -# platform/ios/sdk-files.json -# Objc files for the iOS source -objc_library( - name = "objc-sdk", - srcs = [ - "platform/darwin/src/MLNAttributedExpression.m", - "platform/darwin/src/MLNClockDirectionFormatter.m", - "platform/darwin/src/MLNCompassDirectionFormatter.m", - "platform/darwin/src/MLNCoordinateFormatter.m", - "platform/darwin/src/MLNDistanceFormatter.m", - "platform/darwin/src/MLNLocationManager.m", - "platform/darwin/src/MLNReachability.m", - "platform/darwin/src/MLNRendererConfiguration.m", - "platform/darwin/src/MLNTypes.m", - "platform/darwin/src/NSString+MLNAdditions.m", - "platform/darwin/src/NSURL+MLNAdditions.m", - "platform/darwin/src/NSValue+MLNAdditions.m", - "platform/ios/src/MLNAnnotationContainerView.m", - "platform/ios/src/MLNAnnotationImage.m", - "platform/ios/src/MLNCompactCalloutView.m", - "platform/ios/src/MLNUserLocation.m", - "platform/ios/src/MLNUserLocationAnnotationView.m", - "platform/ios/src/MLNUserLocationAnnotationViewStyle.m", - "platform/ios/src/MLNUserLocationHeadingArrowLayer.m", - "platform/ios/src/MLNUserLocationHeadingBeamLayer.m", - "platform/ios/src/NSOrthography+MLNAdditions.m", - "platform/ios/src/UIDevice+MLNAdditions.m", - "platform/ios/src/UIView+MLNAdditions.m", - "platform/ios/src/UIViewController+MLNAdditions.m", - ], - hdrs = [ - "platform/darwin/include/mbgl/util/image+MLNAdditions.hpp", - ], - copts = WARNING_FLAGS["ios"] + MAPLIBRE_FLAGS + [ - "-fmodules", - "-Wno-gnu-zero-variadic-macro-arguments", - "-Wno-variadic-macros", - "-Wno-gnu-conditional-omitted-operand", - ], - includes = [ - "platform/darwin/include", - ], - deps = [ - "objc-headers", - "//:mbgl-core", - "//platform/darwin:darwin-objc", - "//platform/default:mbgl-default", - "//platform/ios/platform/ios/vendor:SMCalloutView", - ], -) - -# Common headers between objc and objcpp libraries. -objc_library( - name = "objc-headers", - srcs = glob([ - "platform/darwin/src/*.h", - "platform/ios/src/*.h", - ]), - includes = [ - "platform/darwin/src", - "platform/ios/src", - ], - sdk_frameworks = [ - "CoreGraphics", - "CoreLocation", - "QuartzCore", - ], - deps = [ - "//platform/darwin:darwin-objc", - "//platform/darwin:darwin-objcpp", - ], -) - -objc_library( - name = "sdk-headers", - hdrs = ["platform/ios/src/Mapbox.h"] + _PUBLIC_HEADERS, -) - -objc_library( - name = "iosapp", - defines = ["GLES_SILENCE_DEPRECATION"], - srcs = [ - "platform/darwin/app/LimeGreenStyleLayer.h", - "platform/darwin/app/LimeGreenStyleLayer.m", - "platform/ios/app/MBXAnnotationView.m", - "platform/ios/app/MBXAppDelegate.m", - "platform/ios/app/MBXCustomCalloutView.h", - "platform/ios/app/MBXCustomCalloutView.m", - "platform/ios/app/MBXCustomLocationViewController.m", - "platform/ios/app/MBXEmbeddedMapViewController.m", - "platform/ios/app/MBXFrameTimeGraphView.m", - "platform/ios/app/MBXOfflinePacksTableViewController.m", - "platform/ios/app/MBXOrnamentsViewController.m", - "platform/ios/app/MBXSnapshotsViewController.m", - "platform/ios/app/MBXState.m", - "platform/ios/app/MBXStateManager.m", - "platform/ios/app/MBXUserLocationAnnotationView.m", - "platform/ios/app/MBXViewController.m", - "platform/ios/app/main.m", - ], - hdrs = [ - "platform/ios/app/MBXAnnotationView.h", - "platform/ios/app/MBXAppDelegate.h", - "platform/ios/app/MBXCustomLocationViewController.h", - "platform/ios/app/MBXEmbeddedMapViewController.h", - "platform/ios/app/MBXFrameTimeGraphView.h", - "platform/ios/app/MBXOfflinePacksTableViewController.h", - "platform/ios/app/MBXOrnamentsViewController.h", - "platform/ios/app/MBXSnapshotsViewController.h", - "platform/ios/app/MBXState.h", - "platform/ios/app/MBXStateManager.h", - "platform/ios/app/MBXUserLocationAnnotationView.h", - "platform/ios/app/MBXViewController.h", - "platform/ios/app/MLNMapView_Experimental.h", - ], - data = glob([ - "platform/ios/app/Assets.xcassets/**", - ]), - includes = [ - "platform/darwin/app", - "platform/darwin/src", - "platform/ios/src", - ], - sdk_frameworks = [ - "GLKit", # needed for LimeGreenStyleLayer - ], - deps = [ - "sdk-headers", - ], + visibility = ["//visibility:public"], ) _IOS_APPLICATION_RESOURCES = [ @@ -394,7 +161,7 @@ _IOS_APPLICATION_RESOURCES = [ ios_application( name = "App", - bundle_id = "org.maplibre.app", + bundle_id = "{}.maplibre.app".format(BUNDLE_ID_PREFIX), families = [ "iphone", "ipad", @@ -404,7 +171,6 @@ ios_application( provisioning_profile = "xcode_profile", resources = _IOS_APPLICATION_RESOURCES, visibility = ["//visibility:public"], - provisioning_profile = ":xcode_profile", deps = [ "//platform:iosapp", ], @@ -425,7 +191,6 @@ ios_application( provisioning_profile = ":xcode_profile", resources = _IOS_APPLICATION_RESOURCES, visibility = ["//visibility:public"], - provisioning_profile = ":xcode_profile", deps = [ "//platform:iosapp", ], @@ -472,12 +237,6 @@ xcodeproj( minimum_xcode_version = "14", project_name = "MapLibre", tags = ["manual"], - bazel_env = {"PATH": "/bin:/usr/bin:/usr/local/bin:/opt/homebrew/bin"}, - default_xcode_configuration = "Debug", - xcode_configurations = { - "Debug": {"//command_line_option:compilation_mode": "dbg"}, - "Release": {"//command_line_option:compilation_mode": "opt"} - }, top_level_targets = [ top_level_target( "App", @@ -514,6 +273,13 @@ xcodeproj( "device", ], ), + top_level_target( + "//platform/ios/test/core:CppUnitTests", + target_environments = [ + "simulator", + "device", + ], + ), ], xcode_configurations = { "Debug": {"//command_line_option:compilation_mode": "dbg"}, diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js index e5f97aac2..d2a23f60d 100755 --- a/scripts/generate-style-code.js +++ b/scripts/generate-style-code.js @@ -22,35 +22,6 @@ const args = (() => { return parser.parse_args(); })(); -let writeGenerated; -if (args.root) { - const targetRoot = path.join(args.root, "__generated__"); - if (args.root) { - if (!fs.existsSync(targetRoot)) { - fs.mkdirSync(); - } - } - - writeGenerated = (pathString, contents) => { - const location = path.parse( - path.relative(__dirname + "/../", path.normalize(pathString)) - ); - - pathString = path.join(targetRoot, location.dir); - if (!fs.existsSync(pathString)) { - fs.mkdirSync(pathString, {recursive: true}); - } - - writeIfModified( - path.join(pathString, location.name + location.ext), contents); - } -} else { - writeGenerated = (pathString, contents) => { - writeIfModified(pathString, contents); - }; -} - - function parseCSSColor(str) { const color = colorParser.parseCSSColor(str); return [ @@ -302,16 +273,16 @@ const layers = Object.keys(spec.layer.type.values).map((type) => { for (const layer of layers) { const layerFileName = layer.type.replace('-', '_'); - writeGenerated(`${__dirname}/../src/mbgl/style/layers/${layerFileName}_layer_properties.hpp`, propertiesHpp(layer)); - writeGenerated(`${__dirname}/../src/mbgl/style/layers/${layerFileName}_layer_properties.cpp`, propertiesCpp(layer)); + writeIfModified(`src/mbgl/style/layers/${layerFileName}_layer_properties.hpp`, propertiesHpp(layer), args.root); + writeIfModified(`src/mbgl/style/layers/${layerFileName}_layer_properties.cpp`, propertiesCpp(layer), args.root); // Remove our fake property for the external interace. if (layer.type === 'line') { layer.paintProperties = layer.paintProperties.filter(property => property.name !== 'line-floor-width'); } - writeGenerated(`${__dirname}/../include/mbgl/style/layers/${layerFileName}_layer.hpp`, layerHpp(layer)); - writeGenerated(`${__dirname}/../src/mbgl/style/layers/${layerFileName}_layer.cpp`, layerCpp(layer)); + writeIfModified(`include/mbgl/style/layers/${layerFileName}_layer.hpp`, layerHpp(layer), args.root); + writeIfModified(`src/mbgl/style/layers/${layerFileName}_layer.cpp`, layerCpp(layer), args.root); } // Light @@ -327,7 +298,7 @@ const lightProperties = Object.keys(spec[`light`]).reduce((memo, name) => { // to get a deterministic order. lightProperties.sort((a, b) => collator.compare(a.name, b.name)); -const lightHpp = ejs.compile(fs.readFileSync(`${__dirname}/../include/mbgl/style/light.hpp.ejs`, 'utf8'), {strict: true}); -const lightCpp = ejs.compile(fs.readFileSync(`${__dirname}/../src/mbgl/style/light.cpp.ejs`, 'utf8'), {strict: true}); -writeGenerated(`${__dirname}/../include/mbgl/style/light.hpp`, lightHpp({properties: lightProperties})); -writeGenerated(`${__dirname}/../src/mbgl/style/light.cpp`, lightCpp({properties: lightProperties})); +const lightHpp = ejs.compile(fs.readFileSync(`include/mbgl/style/light.hpp.ejs`, 'utf8'), {strict: true}); +const lightCpp = ejs.compile(fs.readFileSync(`src/mbgl/style/light.cpp.ejs`, 'utf8'), {strict: true}); +writeIfModified(`include/mbgl/style/light.hpp`, lightHpp({properties: lightProperties}), args.root); +writeIfModified(`src/mbgl/style/light.cpp`, lightCpp({properties: lightProperties}), args.root); diff --git a/shaders/drawable.line_sdf.fragment.glsl b/shaders/drawable.line_sdf.fragment.glsl index c15478885..72f3edafb 100644 --- a/shaders/drawable.line_sdf.fragment.glsl +++ b/shaders/drawable.line_sdf.fragment.glsl @@ -32,7 +32,6 @@ layout (std140) uniform LineSDFInterpolationUBO { lowp float u_offset_t; lowp float u_width_t; lowp float u_floorwidth_t; - highp float pad2; }; diff --git a/shaders/drawable.line_sdf.vertex.glsl b/shaders/drawable.line_sdf.vertex.glsl index 879857830..40f167639 100644 --- a/shaders/drawable.line_sdf.vertex.glsl +++ b/shaders/drawable.line_sdf.vertex.glsl @@ -46,7 +46,6 @@ layout (std140) uniform LineSDFInterpolationUBO { lowp float u_offset_t; lowp float u_width_t; lowp float u_floorwidth_t; - highp float pad2; }; diff --git a/shaders/generate_shader_code.js b/shaders/generate_shader_code.js index b6266a5c1..af48723bd 100644 --- a/shaders/generate_shader_code.js +++ b/shaders/generate_shader_code.js @@ -221,13 +221,11 @@ const args = (() => { // Generate shader source headers const shaderRoot = "shaders/"; +const outputRoot = path.join((args.root ? args.root : ""), "include/mbgl/shaders"); let generatedHeaders = []; let shaderNames = []; -const targetRoot = path.join(args.root, "__generated__"); -if (!fs.existsSync(targetRoot)) { - fs.mkdirSync(); -} +console.log("Writing shaders to ", outputRoot); JSON.parse(fs.readFileSync(path.join(shaderRoot, "manifest.json"))) .filter(it => typeof it == "object") @@ -245,7 +243,7 @@ JSON.parse(fs.readFileSync(path.join(shaderRoot, "manifest.json"))) ? pragmaMapConvertOnlyVertexArrays(vertexSource, pragmaMap, attribMap, "vertex") : pragmaMapConvert(vertexSource, pragmaMap, attribMap, "vertex"); - const glRoot = path.join(args.root, "__generated__/include/mbgl/shaders/gl"); + const glRoot = path.join(outputRoot, "gl"); if (!fs.existsSync(glRoot)) { fs.mkdirSync(glRoot, {recursive: true}); // Ensure target directory is available } @@ -275,7 +273,7 @@ struct ShaderSource { ); // Generate the manifest -fs.writeFileSync(path.join(args.root, "__generated__/include/mbgl/shaders/shader_manifest.hpp"), +fs.writeFileSync(path.join(outputRoot, "shader_manifest.hpp"), `${generatedHeader} #pragma once #include @@ -286,7 +284,7 @@ ${generatedHeaders.join('\n')} `); // Generate shader_source.hpp -fs.writeFileSync(path.join(args.root, "__generated__/include/mbgl/shaders/shader_source.hpp"), +fs.writeFileSync(path.join(outputRoot, "shader_source.hpp"), `${generatedHeader} #pragma once #include