Switch to spotless and format code (#1196)

* Add spotless configuration

* Reformat!

* Add copyright config for build.gradle.kts files

* Add toeholds for headers
This commit is contained in:
Zac Sweers
2020-08-27 23:40:15 -04:00
committed by GitHub
parent 701d6ba968
commit 538890e8c0
109 changed files with 6748 additions and 4972 deletions

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@@ -28,8 +29,8 @@ tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf(
"-progressive",
"-Xopt-in=com.squareup.kotlinpoet.metadata.KotlinPoetMetadataPreview"
"-progressive",
"-Xopt-in=com.squareup.kotlinpoet.metadata.KotlinPoetMetadataPreview"
)
}
}
@@ -80,8 +81,10 @@ val shadowJar = tasks.shadowJar.apply {
archiveClassifier.set("")
configurations = listOf(shade)
relocate("com.squareup.kotlinpoet.metadata", "com.squareup.moshi.kotlinpoet.metadata")
relocate("com.squareup.kotlinpoet.classinspector",
"com.squareup.moshi.kotlinpoet.classinspector")
relocate(
"com.squareup.kotlinpoet.classinspector",
"com.squareup.moshi.kotlinpoet.classinspector"
)
relocate("kotlinx.metadata", "com.squareup.moshi.kotlinx.metadata")
transformers.add(ServiceFileTransformer())
}