Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewparmet committed Dec 15, 2024
1 parent 9997e04 commit 6ccf5b0
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 45 deletions.
25 changes: 25 additions & 0 deletions buildSrc/src/main/kotlin/KotlinJsUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2024 Toast, Inc.
*
* 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
* 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.
*/

import org.gradle.api.Project
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.tasks.Copy
import org.gradle.kotlin.dsl.named

fun Project.cleanUpJsProcessResourcesTask() {
tasks.named<Copy>("jsProcessResources") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2024 Toast, Inc.
*
* 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
* 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.
*/

plugins {
id("protokt.multiplatform-conventions")
}

enablePublishing()
trackKotlinApiCompatibility()
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2024 Toast, Inc.
*
* 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
* 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.
*/

plugins {
id("protokt.multiplatform-published-conventions")
}

cleanUpJsProcessResourcesTask()
1 change: 1 addition & 0 deletions examples/protos/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ plugins {
}

localProtokt()
cleanUpJsProcessResourcesTask()

protokt {
generate {
Expand Down
4 changes: 1 addition & 3 deletions extensions/protokt-extensions-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
*/

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-conventions")
}

enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()
4 changes: 1 addition & 3 deletions extensions/protokt-extensions-lite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ import protokt.v1.gradle.protokt
import protokt.v1.gradle.protoktExtensions

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-proto-conventions")
}

localProtokt()
enablePublishing()
trackKotlinApiCompatibility()

spotless {
kotlin {
Expand Down
5 changes: 1 addition & 4 deletions extensions/protokt-extensions-simple/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
*/

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-conventions")
}

enablePublishing()
trackKotlinApiCompatibility()

kotlin {
sourceSets {
val jvmMain by getting {
Expand Down
4 changes: 1 addition & 3 deletions extensions/protokt-extensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ import com.google.protobuf.gradle.proto
import protokt.v1.gradle.protokt

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-proto-conventions")
}

localProtokt()
enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()

spotless {
kotlin {
Expand Down
4 changes: 1 addition & 3 deletions protokt-core-lite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ import com.google.protobuf.gradle.protobuf
import protokt.v1.gradle.protokt

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-proto-conventions")
kotlin("kapt")
}

localProtokt()
enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()

spotless {
kotlin {
Expand Down
4 changes: 1 addition & 3 deletions protokt-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ import com.google.protobuf.gradle.protobuf
import protokt.v1.gradle.protokt

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-proto-conventions")
}

localProtokt()
enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()

spotless {
kotlin {
Expand Down
4 changes: 1 addition & 3 deletions protokt-reflect/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ import com.google.protobuf.gradle.proto
import protokt.v1.gradle.testProtoktExtensions

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-proto-conventions")
}

localProtokt(false)
enablePublishing()
trackKotlinApiCompatibility()

kotlin {
sourceSets {
Expand Down
4 changes: 1 addition & 3 deletions protokt-runtime-grpc-lite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
*/

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-conventions")
}

enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()

kotlin {
sourceSets {
Expand Down
4 changes: 1 addition & 3 deletions protokt-runtime-grpc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
*/

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-conventions")
}

enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()

kotlin {
sourceSets {
Expand Down
4 changes: 1 addition & 3 deletions protokt-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
*/

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-conventions")
}

enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()

kotlin {
sourceSets {
Expand Down
1 change: 1 addition & 0 deletions testing/conformance/driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ plugins {
}

localProtokt()
cleanUpJsProcessResourcesTask()

kotlin {
sourceSets {
Expand Down
1 change: 1 addition & 0 deletions testing/multiplatform-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ plugins {
}

localProtokt()
cleanUpJsProcessResourcesTask()

kotlin {
sourceSets {
Expand Down
12 changes: 1 addition & 11 deletions third-party/proto-google-common-protos-lite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
import protokt.v1.gradle.protokt

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-proto-conventions")
}

localProtokt()
enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()

protokt {
generate {
Expand Down Expand Up @@ -52,11 +50,3 @@ sourceSets {
}
}
}

sourceSets {
test {
java {
srcDir(rootProject.file("shared-src/lite-util"))
}
}
}
4 changes: 1 addition & 3 deletions third-party/proto-google-common-protos/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
import protokt.v1.gradle.protokt

plugins {
id("protokt.multiplatform-conventions")
id("protokt.multiplatform-published-proto-conventions")
}

localProtokt()
enablePublishing()
compatibleWithAndroid()
trackKotlinApiCompatibility()

protokt {
generate {
Expand Down

0 comments on commit 6ccf5b0

Please sign in to comment.