-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate buildconfig plugin to project to replace old version templa…
…tes work (#677) This uses a nicer plugin to handle buildconfig constants <!-- ⬆ Put your description above this! ⬆ Please be descriptive and detailed. Please read our [Contributing Guidelines](https://github.com/tinyspeck/slack-gradle-plugin/blob/main/.github/CONTRIBUTING.md) and [Code of Conduct](https://slackhq.github.io/code-of-conduct). Don't worry about deleting this, it's not visible in the PR! -->
- Loading branch information
Showing
18 changed files
with
172 additions
and
137 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
plugins { | ||
kotlin("jvm") | ||
alias(libs.plugins.ksp) | ||
alias(libs.plugins.mavenPublish) | ||
alias(libs.plugins.buildConfig) | ||
} | ||
|
||
buildConfig { | ||
packageName("slack.gradle.agphandler.v82") | ||
buildConfigField("String", "AGP_VERSION", libs.versions.agp.map { "\"$it\"" }) | ||
useKotlinOutput { | ||
topLevelConstants = true | ||
internalVisibility = true | ||
} | ||
} | ||
|
||
dependencies { | ||
ksp(libs.autoService.ksp) | ||
|
||
api(projects.agpHandlers.agpHandlerApi) | ||
|
||
implementation(libs.autoService.annotations) | ||
|
||
compileOnly(gradleApi()) | ||
compileOnly(libs.agp) | ||
} |
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,3 @@ | ||
POM_ARTIFACT_ID=sgp-agp-handler-82 | ||
POM_NAME=Slack Gradle Plugin (AGP Handler 8.2) | ||
POM_DESCRIPTION=Slack Gradle Plugin (AGP Handler 8.2) |
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
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
42 changes: 42 additions & 0 deletions
42
agp-handlers/agp-handler-api/src/test/kotlin/slack/gradle/agp/AgpHandlersTest.kt
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,42 @@ | ||
/* | ||
* Copyright (C) 2023 Slack Technologies, LLC | ||
* | ||
* Licensed 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 | ||
* | ||
* https://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 slack.gradle.agp | ||
|
||
import com.google.common.truth.Truth.assertThat | ||
import org.junit.Test | ||
|
||
class AgpHandlersTest { | ||
@Test | ||
fun parseTest() { | ||
assertVersion("8.0.0-alpha01") | ||
assertVersion("8.0.0-beta01") | ||
assertVersion("8.0.0-beta11") | ||
assertVersion("8.0.0-rc11") | ||
assertVersion("8.0.0-dev") | ||
} | ||
|
||
private fun assertVersion(version: String) { | ||
val versionToCheck = | ||
if (version[version.lastIndex - 1] == '0') { | ||
// AGP doesn't print the leading zero in their versions here | ||
version.substring(0, version.lastIndex - 1) + version[version.lastIndex] | ||
} else { | ||
version | ||
} | ||
assertThat(computeAndroidPluginVersion(version).toString()) | ||
.isEqualTo("Android Gradle Plugin version $versionToCheck") | ||
} | ||
} |
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
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.