From 018a49bd017eb8ece8fa6d22b9e865fd84ac7416 Mon Sep 17 00:00:00 2001 From: breensmbaka Date: Thu, 27 Jul 2023 15:41:53 +0300 Subject: [PATCH] Use JAVA JDK 17, add spotless check when building project. Also add a job workflow to run spotless check when a pull request is merged or a push is merged to master --- .../ISSUE_TEMPLATE/pull_request_template.md | 11 ++++--- .github/workflows/android.yml | 14 ++++++++ BeeTablesCompose/build.gradle.kts | 15 +++++++++ .../ExampleInstrumentedTest.kt | 23 ++++++++++--- .../beetablescompose/BeeTablesCompose.kt | 15 +++++++++ .../components/TableHeaderComponent.kt | 15 +++++++++ .../components/TableRowComponent.kt | 15 +++++++++ .../beetablescompose/utils/DataClassToList.kt | 15 +++++++++ .../beetablescompose/ExampleUnitTest.kt | 20 +++++++++-- README.md | 2 +- app/build.gradle.kts | 15 +++++++++ .../ExampleInstrumentedTest.kt | 23 ++++++++++--- .../breens/beetablescompose/MainActivity.kt | 15 +++++++++ .../breens/beetablescompose/ui/theme/Color.kt | 17 +++++++++- .../breens/beetablescompose/ui/theme/Theme.kt | 27 +++++++++++---- .../breens/beetablescompose/ui/theme/Type.kt | 23 ++++++++++--- .../breens/beetablescompose/utils/Teams.kt | 15 +++++++++ .../beetablescompose/ExampleUnitTest.kt | 20 +++++++++-- build.gradle.kts | 33 +++++++++++++++++++ spotless/copyright.kt | 15 +++++++++ 20 files changed, 315 insertions(+), 33 deletions(-) create mode 100644 spotless/copyright.kt diff --git a/.github/ISSUE_TEMPLATE/pull_request_template.md b/.github/ISSUE_TEMPLATE/pull_request_template.md index 7bf3c15..6fbca57 100644 --- a/.github/ISSUE_TEMPLATE/pull_request_template.md +++ b/.github/ISSUE_TEMPLATE/pull_request_template.md @@ -13,11 +13,12 @@ Explain examples with code for this updates. 3. If its a documentation update: [documentation/*] ### Preparing a pull request for review -1. Your pull request must pass the CI workflow before request a review to any of the maintainers, if not fix the issue first: -2. 🚨Always make a pull request against the develop branch. -3. Always have descriptive commit messages. -4. Always have a description for your pull request, it will be great if you include video recording or screenshots if possible. -5. If you need help with the above please feel free to let me know +1. Before pushing your changes makes sure to run **"./gradlew spotlessCheck"** and **"./gradlewSpotlessApply"**. If there are any linting issues please fix them before creating a pull request. +2. Your pull request must pass the CI workflow before request a review to any of the maintainers, if not fix the issue first: +3. 🚨Always make a pull request against the develop branch. +4. Always have descriptive commit messages explaining what you did. +5. Always have a description for your pull request to explain what you did in depth, it will be great if you include video recording or screenshots if possible. +6. If you need help with the above please feel to reach out to me and I will help you out. ## Code reviews All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for more information on using pull requests. diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 4c99c09..5cb998b 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -7,6 +7,20 @@ on: branches: [ '*' ] jobs: + lint: + name: Spotless check + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3.1.0 + - name: Set up JDK + uses: actions/setup-java@v3.5.1 + with: + distribution: 'zulu' + java-version: 17 + - name: spotless + run: ./gradlew spotlessCheck + build: name: Build and Tests runs-on: ubuntu-latest diff --git a/BeeTablesCompose/build.gradle.kts b/BeeTablesCompose/build.gradle.kts index 352ebe4..d7a309d 100644 --- a/BeeTablesCompose/build.gradle.kts +++ b/BeeTablesCompose/build.gradle.kts @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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("com.android.library") id("org.jetbrains.kotlin.android") diff --git a/BeeTablesCompose/src/androidTest/java/com/breens/beetablescompose/ExampleInstrumentedTest.kt b/BeeTablesCompose/src/androidTest/java/com/breens/beetablescompose/ExampleInstrumentedTest.kt index f2d0112..74811dd 100644 --- a/BeeTablesCompose/src/androidTest/java/com/breens/beetablescompose/ExampleInstrumentedTest.kt +++ b/BeeTablesCompose/src/androidTest/java/com/breens/beetablescompose/ExampleInstrumentedTest.kt @@ -1,13 +1,26 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose -import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 - +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith -import org.junit.Assert.* - /** * Instrumented test, which will execute on an Android device. * @@ -21,4 +34,4 @@ class ExampleInstrumentedTest { val appContext = InstrumentationRegistry.getInstrumentation().targetContext assertEquals("com.breens.beetablescompose.test", appContext.packageName) } -} \ No newline at end of file +} diff --git a/BeeTablesCompose/src/main/java/com/breens/beetablescompose/BeeTablesCompose.kt b/BeeTablesCompose/src/main/java/com/breens/beetablescompose/BeeTablesCompose.kt index a5ee78b..ad9e562 100644 --- a/BeeTablesCompose/src/main/java/com/breens/beetablescompose/BeeTablesCompose.kt +++ b/BeeTablesCompose/src/main/java/com/breens/beetablescompose/BeeTablesCompose.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose import androidx.compose.foundation.layout.Column diff --git a/BeeTablesCompose/src/main/java/com/breens/beetablescompose/components/TableHeaderComponent.kt b/BeeTablesCompose/src/main/java/com/breens/beetablescompose/components/TableHeaderComponent.kt index 612956e..ae18abb 100644 --- a/BeeTablesCompose/src/main/java/com/breens/beetablescompose/components/TableHeaderComponent.kt +++ b/BeeTablesCompose/src/main/java/com/breens/beetablescompose/components/TableHeaderComponent.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose.components import androidx.compose.foundation.background diff --git a/BeeTablesCompose/src/main/java/com/breens/beetablescompose/components/TableRowComponent.kt b/BeeTablesCompose/src/main/java/com/breens/beetablescompose/components/TableRowComponent.kt index 8d2b7a5..dec1e79 100644 --- a/BeeTablesCompose/src/main/java/com/breens/beetablescompose/components/TableRowComponent.kt +++ b/BeeTablesCompose/src/main/java/com/breens/beetablescompose/components/TableRowComponent.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose.components import androidx.compose.foundation.background diff --git a/BeeTablesCompose/src/main/java/com/breens/beetablescompose/utils/DataClassToList.kt b/BeeTablesCompose/src/main/java/com/breens/beetablescompose/utils/DataClassToList.kt index 262cc5b..99529e6 100644 --- a/BeeTablesCompose/src/main/java/com/breens/beetablescompose/utils/DataClassToList.kt +++ b/BeeTablesCompose/src/main/java/com/breens/beetablescompose/utils/DataClassToList.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose.utils import kotlin.reflect.KProperty1 diff --git a/BeeTablesCompose/src/test/java/com/breens/beetablescompose/ExampleUnitTest.kt b/BeeTablesCompose/src/test/java/com/breens/beetablescompose/ExampleUnitTest.kt index 82ec3ec..0fd5880 100644 --- a/BeeTablesCompose/src/test/java/com/breens/beetablescompose/ExampleUnitTest.kt +++ b/BeeTablesCompose/src/test/java/com/breens/beetablescompose/ExampleUnitTest.kt @@ -1,9 +1,23 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert.* - /** * Example local unit test, which will execute on the development machine (host). * @@ -14,4 +28,4 @@ class ExampleUnitTest { fun addition_isCorrect() { assertEquals(4, 2 + 2) } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 0fc15ab..c2eacf6 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ implementation("androidx.compose.material3:material3:1.1.1") ```gradle dependencies { - implementation("com.breens.bee-tables-compose:1.0.0") + implementation("com.github.Breens-Mbaka:BeeTablesCompose:1.0.0") } ``` diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c717dd0..1e49150 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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("com.android.application") id("org.jetbrains.kotlin.android") diff --git a/app/src/androidTest/java/com/breens/beetablescompose/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/breens/beetablescompose/ExampleInstrumentedTest.kt index 6c1f227..1cc3a7e 100644 --- a/app/src/androidTest/java/com/breens/beetablescompose/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/com/breens/beetablescompose/ExampleInstrumentedTest.kt @@ -1,13 +1,26 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose -import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 - +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith -import org.junit.Assert.* - /** * Instrumented test, which will execute on an Android device. * @@ -21,4 +34,4 @@ class ExampleInstrumentedTest { val appContext = InstrumentationRegistry.getInstrumentation().targetContext assertEquals("com.breens.beetablescompose", appContext.packageName) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/breens/beetablescompose/MainActivity.kt b/app/src/main/java/com/breens/beetablescompose/MainActivity.kt index 9e9e626..91abbd8 100644 --- a/app/src/main/java/com/breens/beetablescompose/MainActivity.kt +++ b/app/src/main/java/com/breens/beetablescompose/MainActivity.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose import android.os.Bundle diff --git a/app/src/main/java/com/breens/beetablescompose/ui/theme/Color.kt b/app/src/main/java/com/breens/beetablescompose/ui/theme/Color.kt index f0d842a..29346ac 100644 --- a/app/src/main/java/com/breens/beetablescompose/ui/theme/Color.kt +++ b/app/src/main/java/com/breens/beetablescompose/ui/theme/Color.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose.ui.theme import androidx.compose.ui.graphics.Color @@ -8,4 +23,4 @@ val Pink80 = Color(0xFFEFB8C8) val Purple40 = Color(0xFF6650a4) val PurpleGrey40 = Color(0xFF625b71) -val Pink40 = Color(0xFF7D5260) \ No newline at end of file +val Pink40 = Color(0xFF7D5260) diff --git a/app/src/main/java/com/breens/beetablescompose/ui/theme/Theme.kt b/app/src/main/java/com/breens/beetablescompose/ui/theme/Theme.kt index e98d2dc..7e21159 100644 --- a/app/src/main/java/com/breens/beetablescompose/ui/theme/Theme.kt +++ b/app/src/main/java/com/breens/beetablescompose/ui/theme/Theme.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose.ui.theme import android.app.Activity @@ -18,13 +33,13 @@ import androidx.core.view.WindowCompat private val DarkColorScheme = darkColorScheme( primary = Purple80, secondary = PurpleGrey80, - tertiary = Pink80 + tertiary = Pink80, ) private val LightColorScheme = lightColorScheme( primary = Purple40, secondary = PurpleGrey40, - tertiary = Pink40 + tertiary = Pink40, /* Other default colors to override background = Color(0xFFFFFBFE), @@ -34,7 +49,7 @@ private val LightColorScheme = lightColorScheme( onTertiary = Color.White, onBackground = Color(0xFF1C1B1F), onSurface = Color(0xFF1C1B1F), - */ + */ ) @Composable @@ -42,7 +57,7 @@ fun BeeTablesComposeTheme( darkTheme: Boolean = isSystemInDarkTheme(), // Dynamic color is available on Android 12+ dynamicColor: Boolean = true, - content: @Composable () -> Unit + content: @Composable () -> Unit, ) { val colorScheme = when { dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { @@ -65,6 +80,6 @@ fun BeeTablesComposeTheme( MaterialTheme( colorScheme = colorScheme, typography = Typography, - content = content + content = content, ) -} \ No newline at end of file +} diff --git a/app/src/main/java/com/breens/beetablescompose/ui/theme/Type.kt b/app/src/main/java/com/breens/beetablescompose/ui/theme/Type.kt index e02c630..94f06a2 100644 --- a/app/src/main/java/com/breens/beetablescompose/ui/theme/Type.kt +++ b/app/src/main/java/com/breens/beetablescompose/ui/theme/Type.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose.ui.theme import androidx.compose.material3.Typography @@ -13,8 +28,8 @@ val Typography = Typography( fontWeight = FontWeight.Normal, fontSize = 16.sp, lineHeight = 24.sp, - letterSpacing = 0.5.sp - ) + letterSpacing = 0.5.sp, + ), /* Other default text styles to override titleLarge = TextStyle( fontFamily = FontFamily.Default, @@ -30,5 +45,5 @@ val Typography = Typography( lineHeight = 16.sp, letterSpacing = 0.5.sp ) - */ -) \ No newline at end of file + */ +) diff --git a/app/src/main/java/com/breens/beetablescompose/utils/Teams.kt b/app/src/main/java/com/breens/beetablescompose/utils/Teams.kt index 637de2f..4260864 100644 --- a/app/src/main/java/com/breens/beetablescompose/utils/Teams.kt +++ b/app/src/main/java/com/breens/beetablescompose/utils/Teams.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose.utils data class Teams( diff --git a/app/src/test/java/com/breens/beetablescompose/ExampleUnitTest.kt b/app/src/test/java/com/breens/beetablescompose/ExampleUnitTest.kt index 82ec3ec..0fd5880 100644 --- a/app/src/test/java/com/breens/beetablescompose/ExampleUnitTest.kt +++ b/app/src/test/java/com/breens/beetablescompose/ExampleUnitTest.kt @@ -1,9 +1,23 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ package com.breens.beetablescompose +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert.* - /** * Example local unit test, which will execute on the development machine (host). * @@ -14,4 +28,4 @@ class ExampleUnitTest { fun addition_isCorrect() { assertEquals(4, 2 + 2) } -} \ No newline at end of file +} diff --git a/build.gradle.kts b/build.gradle.kts index d4b7451..aaa3032 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,4 +3,37 @@ plugins { id("com.android.application") version "8.1.0-beta02" apply false id("org.jetbrains.kotlin.android") version "1.8.10" apply false id("com.android.library") version "8.1.0-beta02" apply false + id("com.diffplug.spotless") version "6.19.0" apply false } + +subprojects { + apply(plugin = "com.diffplug.spotless") + configure { + kotlin { + target( + fileTree(".") { + include("**/*.kt") + exclude("spotless/copyright.kt", "**/build/**") + }, + ) + ktlint() + licenseHeaderFile(rootProject.file("spotless/copyright.kt")) + trimTrailingWhitespace() + endWithNewline() + } + format("kts") { + target("**/*.kts") + targetExclude("$buildDir/**/*.kts") + licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") + trimTrailingWhitespace() + endWithNewline() + } + } + + afterEvaluate { + tasks.named("preBuild") { + dependsOn("spotlessApply") + } + } +} + diff --git a/spotless/copyright.kt b/spotless/copyright.kt new file mode 100644 index 0000000..95aa7e9 --- /dev/null +++ b/spotless/copyright.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2023 Breens Mbaka + * + * 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. + */ \ No newline at end of file