-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Geocoder native support fixes #1645
- Loading branch information
Showing
26 changed files
with
688 additions
and
133 deletions.
There are no files selected for viewing
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
46 changes: 0 additions & 46 deletions
46
...c/main/java/org/apache/camel/quarkus/component/geocoder/deployment/GeocoderProcessor.java
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
...n-test/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderResource.java
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
55 changes: 55 additions & 0 deletions
55
...c/main/java/org/apache/camel/quarkus/component/geocoder/deployment/GeocoderProcessor.java
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,55 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.camel.quarkus.component.geocoder.deployment; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; | ||
import io.quarkus.deployment.builditem.FeatureBuildItem; | ||
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; | ||
|
||
class GeocoderProcessor { | ||
|
||
private static final String FEATURE = "camel-geocoder"; | ||
|
||
@BuildStep | ||
FeatureBuildItem feature() { | ||
return new FeatureBuildItem(FEATURE); | ||
} | ||
|
||
@BuildStep | ||
ExtensionSslNativeSupportBuildItem activateSslNativeSupport() { | ||
return new ExtensionSslNativeSupportBuildItem(FEATURE); | ||
} | ||
|
||
@BuildStep | ||
List<ReflectiveClassBuildItem> registerReflectiveClasses() { | ||
List<ReflectiveClassBuildItem> items = new ArrayList<ReflectiveClassBuildItem>(); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.GeocodingApi$Response")); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.model.GeocodingResult")); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.model.AddressComponent")); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.model.Geometry")); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.model.AddressType")); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.model.PlusCode")); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.model.Bounds")); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.model.LatLng")); | ||
items.add(new ReflectiveClassBuildItem(false, true, "com.google.maps.model.LocationType")); | ||
return items; | ||
} | ||
} |
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 @@ | ||
Locales different from the build machine's default locale do not work well in native mode due to https://github.com/oracle/graal/issues/1645[this GraalVM bug]. The `google-maps-services` library this extension depends on uses `Locale.English` to format double latitude and longitude values. As a consequence of these two facts, the locale on the building machine must be set to some English locale, such as `en_US.UTF-8`, `en_GB.UTF-8` or `en_IE.UTF-8` so that the calls to the Google Maps API work properly. On Linux, you need to check the value of the `LANG` environment variable, e.g. via `echo $LANG` and change the value via `export LANG=en_US.UTF-8` if necessary. |
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,10 @@ | ||
== Camel Quarkus Geocoder Integration Tests | ||
|
||
To run `camel-quarkus-geocoder` integration tests using google maps service, you will need a google cloud https://developers.google.com/maps/documentation/javascript/get-api-key[API key]. | ||
|
||
Then set the following environment variable: | ||
|
||
[source,shell] | ||
---- | ||
GOOGLE_API_KEY=your-api-id | ||
---- |
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.