Skip to content

Commit f5d0756

Browse files
authored
Merge pull request #99 from ArcGIS/v.next
merge v.next to main
2 parents 16ffc4f + 200e6be commit f5d0756

File tree

226 files changed

+10876
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+10876
-165
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/build
55
/captures
66
.externalNativeBuild
7+
build/
78

89
# Local configuration file (sdk path, etc)
910
/local.properties

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,38 @@
11
# ArcGIS Maps SDK for Kotlin Toolkit
22

3+
The ArcGIS Maps SDK for Kotlin Toolkit contains components that will simplify your Kotlin app development. It is built off of the new ArcGIS Maps SDK for Kotlin.
34

45
## Toolkit Components
56

7+
* **[Authenticator](toolkit/authentication)** - Displays a user interface when network and ArcGIS authentication challenges occur.
8+
* **[Compass](toolkit/compass)** - Shows a compass direction when the map is rotated. Auto-hides when the map points north.
9+
* **[FloorFilter](toolkit/indoors)** - Allows filtering of floor plan data in a geo view by a site, a facility in the site, or a floor in the facility.
10+
611
## Requirements
12+
13+
Please see the [developer setup](doc/general/developer_setup.md) for a complete description of requirements
714
* ArcGIS Maps SDK for Kotlin
815
See [this guide](https://developers.arcgis.com/kotlin/install-and-set-up/) for complete instructions and
916
other options for installing the SDK.
17+
* JDK 17
18+
19+
The *ArcGIS Maps SDK for Kotlin Toolkit* has a *Minimum SDK* version of *26*, meaning that it can run on devices with *Android Oreo (8.0)* or newer.
20+
21+
## Installation
22+
23+
### Using the BOM
24+
25+
The *ArcGIS Maps SDK for Kotlin Toolkit* is released with a "bill of materials" (`BOM`). The releasable BOM is versioned and represents a set of versions of the toolkit components which are compatible with one another. You may specify dependencies as follows
26+
27+
```
28+
implementation(platform('com.esri:arcgis-maps-kotlin-toolkit-bom:200.2.0'))
29+
implementation('com.esri:arcgis-maps-kotlin-toolkit-authenticator')
30+
implementation('com.esri:arcgis-maps-kotlin-toolkit-compass')
31+
```
32+
33+
The template and TemplateApp modules are for bootstrapping new modules.
34+
35+
Please see the [package structure](doc/general/developer_setup.md#package-structure) documentation for more details.
1036

1137
## Issues
1238

@@ -16,6 +42,41 @@ Find a bug or want to request a new feature enhancement? Please let us know by [
1642

1743
Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing).
1844

45+
### Creating a New Toolkit Component
46+
47+
A new toolkit component can be added to this project by running the bash script at the top level
48+
`./new-component-starter.sh -n NameOfNewComponent"`
49+
50+
This will create a new library module for the new component, and a new app module which depends on the library.
51+
Capitalization isn't necessary, but it won't capitalize anything but the first letter if none is specified.
52+
53+
This script requires bash 4.0 or higher.
54+
55+
### About this Repo
56+
57+
The project is structured into two folders, `microapps` and `toolkit` each containing many modules, and a folder for releasing a bill of materials (BOM).
58+
59+
```
60+
arcgis-maps-sdk-kotlin-toolkit
61+
├── bom
62+
│   └── build.gradle.kts
63+
├── microapps
64+
│   └── TemplateApp
65+
│   ├── ...App
66+
├── toolkit
67+
│   ├── template
68+
│   ├── ...
69+
├── build.gradle.kts
70+
└── settings.gradle.kts
71+
```
72+
The `toolkit` folder contains releasable libraries -- these are the components of the toolkit.
73+
For each module in the `toolkit` folder there is a corresponding app in the `microapps` folder which depends on it.
74+
The apps are not released but are useful for working on a particular component in isolation.
75+
76+
The template and TemplateApp modules are for bootstrapping new modules.
77+
78+
Please see the [package structure](doc/general/developer_setup.md#package-structure) documentation for more details.
79+
1980
## Licensing
2081

2182
Copyright 2019-2022 Esri
@@ -26,4 +87,4 @@ http://www.apache.org/licenses/LICENSE-2.0
2687

2788
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.
2889

29-
A copy of the license is available in the repository's [LICENSE](LICENSE) file.
90+
A copy of the license is available in the repository's [LICENSE](LICENSE) file.

authentication/build.gradle

Lines changed: 0 additions & 41 deletions
This file was deleted.

bom/build.gradle.kts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
*
3+
* Copyright 2023 Esri
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
plugins {
20+
id("maven-publish")
21+
id("java-platform")
22+
}
23+
24+
// Find these in properties passed through command line or read from GRADLE_HOME/gradle.properties
25+
// or local gradle.properties
26+
val artifactoryGroupId: String by project
27+
val artifactoryArtifactBaseId: String by project
28+
val artifactoryArtifactId: String = "$artifactoryArtifactBaseId-${project.name}"
29+
val artifactoryUrl: String by project
30+
val artifactoryUsername: String by project
31+
val artifactoryPassword: String by project
32+
val versionNumber: String by project
33+
val buildNumber: String by project
34+
val ignoreBuildNumber: String by project
35+
val artifactVersion: String = if (ignoreBuildNumber == "true") {
36+
versionNumber
37+
} else {
38+
"$versionNumber-$buildNumber"
39+
}
40+
41+
// ensure that the evaluation of the bom project happens after all other projects
42+
// so that plugins are applied to all projects, and can be used to identify
43+
// which projects should get written into the BOM's pom file.
44+
rootProject.subprojects.filter {
45+
it.name != project.name
46+
}.forEach {
47+
evaluationDependsOn(":${it.name}")
48+
}
49+
50+
// now find projects which are publishable based on their inclusion
51+
// of the publishing plugin, and add them as api dependencies.
52+
dependencies {
53+
constraints {
54+
project.rootProject.subprojects.filter {
55+
it.plugins.findPlugin("artifact-deploy") != null
56+
}.forEach { subproject ->
57+
// add all the intended library projects as api dependencies.
58+
api(subproject)
59+
}
60+
}
61+
}
62+
63+
afterEvaluate {
64+
/**
65+
* Maven publication configuration for aar and pom file. Run as follows:
66+
* ./gradlew publishAarPublicationToMavenRepository -PartifactoryUsername=<username> -PartifactoryPassword=<password>
67+
*
68+
* More details:
69+
* https://docs.gradle.org/current/userguide/publishing_maven.html
70+
*/
71+
publishing {
72+
publications {
73+
create<MavenPublication>("bom") {
74+
groupId = artifactoryGroupId
75+
artifactId = artifactoryArtifactId
76+
version = artifactVersion
77+
78+
from(components["javaPlatform"])
79+
}
80+
}
81+
82+
repositories {
83+
maven {
84+
url = uri(artifactoryUrl)
85+
credentials {
86+
username = artifactoryUsername
87+
password = artifactoryPassword
88+
}
89+
}
90+
}
91+
}
92+
}
93+
94+

build.gradle

Lines changed: 0 additions & 5 deletions
This file was deleted.

build.gradle.kts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
*
3+
* Copyright 2023 Esri
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
20+
plugins {
21+
@Suppress("DSL_SCOPE_VIOLATION") // fixed in gradle 8.1
22+
alias(libs.plugins.android.application) apply false
23+
@Suppress("DSL_SCOPE_VIOLATION")
24+
alias(libs.plugins.android.library) apply false
25+
@Suppress("DSL_SCOPE_VIOLATION")
26+
alias(libs.plugins.kotlin.android) apply false
27+
@Suppress("DSL_SCOPE_VIOLATION")
28+
alias(libs.plugins.gradle.secrets) apply false
29+
@Suppress("DSL_SCOPE_VIOLATION")
30+
alias(libs.plugins.kotlin.serialization) apply false
31+
}

buildSrc/build.gradle.kts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
*
3+
* Copyright 2023 Esri
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
repositories {
20+
google()
21+
mavenCentral()
22+
}
23+
24+
plugins {
25+
`kotlin-dsl`
26+
`maven-publish`
27+
}
28+
29+
version = "1.0"
30+
31+
gradlePlugin {
32+
plugins {
33+
create("artifactDeploy") {
34+
group = "internal"
35+
id = "artifact-deploy"
36+
implementationClass = "deploy.ArtifactPublisher"
37+
}
38+
}
39+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
*
3+
* Copyright 2023 Esri
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
package deploy
20+
21+
import org.gradle.api.Plugin
22+
import org.gradle.api.Project
23+
import org.gradle.api.publish.PublishingExtension
24+
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
25+
import org.gradle.kotlin.dsl.*
26+
import org.gradle.api.publish.maven.MavenPublication
27+
import org.gradle.configurationcache.extensions.capitalized
28+
import java.net.URI
29+
30+
/**
31+
* This class will provide maven publication to projects which apply it as a plugin.
32+
* This class does not support platform publication (e.g. a BOM artifact).
33+
*
34+
* Though the name is `ArtifactPublisher` applying this plugin will provide
35+
* all maven publication tasks to a project, such as publishToMavenLocal.
36+
* The name is qualified to not overload the term `Publisher`.
37+
*
38+
* @since 200.2.0
39+
*/
40+
class ArtifactPublisher : Plugin<Project> {
41+
override fun apply(project: Project) {
42+
val artifactoryGroupId: String by project
43+
val artifactoryArtifactBaseId: String by project
44+
val artifactoryUrl: String by project
45+
val artifactoryUsername: String by project
46+
val artifactoryPassword: String by project
47+
val versionNumber: String by project
48+
val ignoreBuildNumber: String by project
49+
val buildNumber: String by project
50+
val artifactVersion: String = if (ignoreBuildNumber == "true") {
51+
versionNumber
52+
} else {
53+
"$versionNumber-$buildNumber"
54+
}
55+
val artifactoryArtifactId: String = "$artifactoryArtifactBaseId-${project.name}"
56+
57+
project.pluginManager.apply(MavenPublishPlugin::class.java)
58+
project.afterEvaluate {
59+
project.extensions.configure<PublishingExtension> {
60+
repositories {
61+
repositories.maven {
62+
url = URI.create(artifactoryUrl)
63+
credentials {
64+
username = artifactoryUsername
65+
password = artifactoryPassword
66+
}
67+
}
68+
}
69+
publications {
70+
publications.create(
71+
project.name,
72+
MavenPublication::class.java
73+
) {
74+
groupId = artifactoryGroupId
75+
artifactId = artifactoryArtifactId
76+
version = artifactVersion
77+
78+
from(project.components["release"])
79+
}
80+
}
81+
}
82+
83+
tasks.findByName("publish${project.name.capitalized()}PublicationToMavenRepository")
84+
?.dependsOn("assembleRelease")
85+
tasks.findByName("publishToMavenLocal")?.dependsOn("assembleRelease")
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)