Skip to content

Commit

Permalink
Merge pull request #46 from klaxit/0.1.3
Browse files Browse the repository at this point in the history
0.1.3 - Update detekt and publish plugin, fix build on Mac M1
  • Loading branch information
ben-j69 authored Dec 22, 2021
2 parents deea269 + b7d4ab9 commit 0a6a856
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v0.1.3
### Fixes
* Fix build on Mac with M1 chip
### Improvements
* Update Gradle, Detekt, and Kotest
# v0.1.2
### Fixes
* Fix call to `customDecode()` in C++ code
Expand Down
15 changes: 11 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("com.gradle.plugin-publish") version "0.14.0"
id("io.gitlab.arturbosch.detekt") version "1.16.0"
id("com.gradle.plugin-publish") version "0.16.0"
id("io.gitlab.arturbosch.detekt") version "1.18.1"
`kotlin-dsl`
`maven-publish`
}
Expand All @@ -14,8 +14,8 @@ repositories {
dependencies {
implementation("com.android.tools.build:gradle:4.1.3")

testImplementation("io.kotest:kotest-runner-junit5-jvm:4.4.3")
testImplementation("io.kotest:kotest-assertions-core-jvm:4.4.3")
testImplementation("io.kotest:kotest-runner-junit5-jvm:4.6.3")
testImplementation("io.kotest:kotest-assertions-core-jvm:4.6.3")
testImplementation("junit:junit:4.13.2")
}

Expand Down Expand Up @@ -43,6 +43,13 @@ gradlePlugin {
}
}

detekt {
reports {
xml.enabled = false
sarif.enabled = false
}
}

tasks.withType<Copy> {
//Required by Gradle 7.0
duplicatesStrategy = DuplicatesStrategy.INCLUDE
Expand Down
1 change: 1 addition & 0 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ style:
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: false
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**' ]
MayBeConst:
active: true
ModifierOrder:
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ rootProject.name = "HiddenSecretsPlugin"

gradle.allprojects {
group = "com.klaxit.hiddensecrets"
version = "0.1.2"
version = "0.1.3"
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ open class HiddenSecretsPlugin : Plugin<Project> {
* Copy Kotlin file Secrets.kt from the lib to the Android project if it does not exist yet
*/
fun copyKotlinFile() {
if (getKotlinFile() != null) {
getKotlinFile()?.let {
println("$KOTLIN_FILE_NAME already exists")
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/CommandNamesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class CommandNamesTest : StringSpec({
HiddenSecretsPlugin.TASK_OBFUSCATE shouldBe "obfuscate"
HiddenSecretsPlugin.TASK_PACKAGE_NAME shouldBe "packageName"
HiddenSecretsPlugin.TASK_FIND_KOTLIN_FILE shouldBe "findKotlinFile"
})
})
5 changes: 3 additions & 2 deletions src/test/kotlin/HiddenSecretsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class HiddenSecretsTest : WordSpec({
"Make command ${HiddenSecretsPlugin.TASK_OBFUSCATE} succeed" {
val result = gradleRunner.withArguments(HiddenSecretsPlugin.TASK_OBFUSCATE, "-Pkey=$key", "-Ppackage=$packageName").build()
println(result.output)
result.output shouldContain "{ 0x15, 0x58, 0xb, 0x43, 0x78, 0x4a, 0x23, 0x6d, 0x1, 0x4b, 0x46, 0x7c, 0x57, 0x41 }" //obfuscated key
//Should contain obfuscated key
result.output shouldContain "{ 0x15, 0x58, 0xb, 0x43, 0x78, 0x4a, 0x23, 0x6d, 0x1, 0x4b, 0x46, 0x7c, 0x57, 0x41 }"
}

"Make command ${HiddenSecretsPlugin.TASK_PACKAGE_NAME} succeed" {
Expand All @@ -58,4 +59,4 @@ class HiddenSecretsTest : WordSpec({
println(result.output)
}
}
})
})
2 changes: 1 addition & 1 deletion src/test/kotlin/UtilsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ class UtilsTest : WordSpec({
kotlinPackage shouldBe "com.test.object"
}
}
})
})

0 comments on commit 0a6a856

Please sign in to comment.