Skip to content

Commit fe8552e

Browse files
authored
Merge branch 'main' into rl/batch_ornament_settings
2 parents 2a10ad0 + 0a60602 commit fe8552e

File tree

5 files changed

+24
-61
lines changed

5 files changed

+24
-61
lines changed

.circleci/config.yml

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ version: 2.1
22

33
orbs:
44
flutter: circleci/[email protected]
5+
macos: circleci/[email protected]
6+
gcp-cli: circleci/[email protected]
57

68
commands:
79

@@ -13,42 +15,11 @@ commands:
1315
echo "machine api.mapbox.com login mapbox password ${SDK_REGISTRY_TOKEN}" >> ~/.netrc
1416
chmod 0600 ~/.netrc
1517
16-
install-gcloud:
17-
# Link for gcloud versions: https://cloud.google.com/sdk/docs/downloads-versioned-archives#installation_instructions
18-
parameters:
19-
version:
20-
type: string
21-
default: "google-cloud-cli-405.0.0-darwin-x86_64.tar.gz"
22-
checksum:
23-
type: string
24-
default: "504852f8ab0c7df62f80d9d687d74c80da68f1e17ad53055fbdb37cf9bbeebc7"
25-
description: "Install gcloud"
26-
steps:
27-
- run:
28-
name: Install gcloud
29-
command: |
30-
mkdir /tmp/gcloud && cd /tmp/gcloud
31-
32-
curl -OL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/<< parameters.version >>
33-
echo '<< parameters.checksum >> *<< parameters.version >>' >> checksumfile
34-
shasum -a 256 -c checksumfile
35-
36-
tar zxvf << parameters.version >>
37-
./google-cloud-sdk/install.sh -q --install-python false
38-
39-
echo "source /tmp/gcloud/google-cloud-sdk/path.bash.inc" >> $BASH_ENV
40-
echo "source /tmp/gcloud/google-cloud-sdk/completion.bash.inc" >> $BASH_ENV
41-
42-
login-gcloud:
18+
setup-gcloud:
4319
steps:
44-
- run:
45-
name: Log in to Google Cloud Platform
46-
command: |
47-
if [[ -n "${GCLOUD_SERVICE_ACCOUNT_JSON}" ]]; then
48-
echo "${GCLOUD_SERVICE_ACCOUNT_JSON}" > secret.json
49-
gcloud auth activate-service-account --key-file secret.json --project mapbox-maps-flutter
50-
rm secret.json
51-
fi
20+
- gcp-cli/setup:
21+
version: 449.0.0
22+
gcloud_service_key: GCLOUD_SERVICE_ACCOUNT_JSON
5223

5324
add-mapbox-submodules-key:
5425
steps:
@@ -69,7 +40,7 @@ jobs:
6940
steps:
7041
- checkout
7142
- flutter/install_sdk_and_pub:
72-
version: 3.13.4
43+
version: 3.13.6
7344
app-dir: example
7445
- run:
7546
name: ktlint
@@ -96,14 +67,11 @@ jobs:
9667
workspace-path:
9768
type: string
9869
default: example/build/app/outputs/apk
99-
docker:
100-
- image: cimg/android:2022.09
101-
resource_class: large
70+
executor: firebase-test-runner
10271
steps:
10372
- attach_workspace:
10473
at: << parameters.workspace-path >>
105-
- install-gcloud
106-
- login-gcloud
74+
- setup-gcloud
10775
- run:
10876
name: "Run Android integration tests on Firebase"
10977
no_output_timeout: 20m
@@ -127,8 +95,9 @@ jobs:
12795
- checkout
12896
- inject-netrc-credentials
12997
- add-mapbox-submodules-key
98+
- macos/install-rosetta
13099
- flutter/install_sdk_and_pub:
131-
version: 3.13.4
100+
version: 3.13.6
132101
app-dir: example
133102
- flutter/install_ios_pod:
134103
app-dir: example
@@ -142,15 +111,11 @@ jobs:
142111
- run:
143112
name: "Build iOS integration tests"
144113
command: |
145-
bundle exec fastlane update_code_signing
146-
147114
pushd example
148115
149116
# required to init configs that pass environment variables to fastlane later
150117
flutter build ios --config-only integration_test/all_test.dart \
151118
--release --dart-define=ACCESS_TOKEN=${MAPBOX_ACCESS_TOKEN}
152-
flutter build ios integration_test/all_test.dart \
153-
--release --dart-define=ACCESS_TOKEN=${MAPBOX_ACCESS_TOKEN}
154119
155120
popd # to repo root
156121
@@ -165,12 +130,11 @@ jobs:
165130
workspace-path:
166131
type: string
167132
default: example/build/output
168-
executor: macos-xcode-latest
133+
executor: firebase-test-runner
169134
steps:
170135
- attach_workspace:
171136
at: << parameters.workspace-path >>
172-
- install-gcloud
173-
- login-gcloud
137+
- setup-gcloud
174138
- run:
175139
name: "Run iOS integration tests on Firebase"
176140
no_output_timeout: 20m
@@ -182,7 +146,6 @@ jobs:
182146
183147
184148
workflows:
185-
version: 2
186149
build:
187150
jobs:
188151
- build-android
@@ -196,6 +159,10 @@ workflows:
196159

197160
executors:
198161
macos-xcode-latest:
199-
resource_class: large
162+
resource_class: macos.m1.medium.gen1
200163
macos:
201-
xcode: 14.1.0
164+
xcode: 15.0.0
165+
firebase-test-runner:
166+
resource_class: small
167+
docker:
168+
- image: cimg/python:3.7

.fastlane/Fastfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ ENV["SPACESHIP_SKIP_2FA_UPGRADE"] = "1"
55

66
platform :ios do
77

8-
lane :update_code_signing do
9-
setup_circle_ci
10-
sync_code_signing(type: "development")
11-
end
12-
138
lane :build_examples_tests do
149
setup_circle_ci
1510
sync_code_signing(type: "development")

android/src/main/kotlin/com/mapbox/maps/mapbox_maps/mapping/AttributionMappings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fun AttributionSettingsInterface.applyFromFLT(settings: FLTSettings.AttributionS
1616
}
1717

1818
fun AttributionSettingsInterface.toFLT() = FLTSettings.AttributionSettings.Builder().let { settings ->
19-
settings.setIconColor(iconColor.toLong())
19+
settings.setIconColor(iconColor.toUInt().toLong())
2020
settings.setPosition(position.toOrnamentPosition())
2121
settings.setMarginLeft(marginLeft.toDouble())
2222
settings.setMarginTop(marginTop.toDouble())

example/integration_test/attribution_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ void main() {
2626
await attribution.updateSettings(settings);
2727
var updatedSettings = await attribution.getSettings();
2828
expect(updatedSettings.position, OrnamentPosition.TOP_RIGHT);
29+
expect(updatedSettings.iconColor, Colors.blue.value);
2930
if (Platform.isIOS) {
31+
// on iOS margins for the current position are preserved
3032
expect(updatedSettings.marginTop, 2);
3133
expect(updatedSettings.marginRight, 3);
3234
} else {
33-
// FIXME colors are decoded incorrectly for some reason
34-
// expect(updatedSettings.iconColor, Colors.blue.value);
3535
expect(updatedSettings.marginLeft, 1);
3636
expect(updatedSettings.marginTop, 2);
3737
expect(updatedSettings.marginRight, 3);

ios/Classes/AttributionController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ class AttributionController: NSObject, FLT_SETTINGSAttributionSettingsInterface
3030
func getSettingsWithError(_ error: AutoreleasingUnsafeMutablePointer<FlutterError?>) -> FLT_SETTINGSAttributionSettings? {
3131
let options = mapView.ornaments.options.attributionButton
3232
let position = getFLT_SETTINGSOrnamentPosition(position: options.position)
33+
let iconColor = mapView.ornaments.attributionButton.tintColor.rgb()
3334

3435
let settings = FLT_SETTINGSAttributionSettings.make(
35-
withIconColor: nil,
36+
withIconColor: NSNumber(value: iconColor),
3637
position: .init(value: position),
3738
marginLeft: NSNumber(value: options.margins.x * UIScreen.main.scale),
3839
marginTop: NSNumber(value: options.margins.y * UIScreen.main.scale),

0 commit comments

Comments
 (0)