From 1141644469246c42d12b1628f111fe25b72d1869 Mon Sep 17 00:00:00 2001 From: Manuel Vivo Date: Thu, 23 Jul 2020 10:00:15 +0200 Subject: [PATCH] [Crane] Adds and applies spotless Change-Id: I14f25a6505cffbf07a629c499c17b0bd1c6a9abb --- Crane/app/build.gradle | 24 ------------------- .../samples/crane/base/BaseUserInput.kt | 4 ++-- .../compose/samples/crane/base/CraneDrawer.kt | 16 +++++++++++++ .../compose/samples/crane/base/CraneTabs.kt | 4 ++-- .../samples/crane/base/ExploreSection.kt | 4 ++-- .../compose/samples/crane/base/Scaffold.kt | 4 ++-- .../samples/crane/base/ServiceLocator.kt | 4 ++-- .../samples/crane/calendar/Calendar.kt | 4 ++-- .../crane/calendar/CalendarActivity.kt | 4 ++-- .../crane/calendar/data/CalendarData.kt | 4 ++-- .../crane/calendar/model/CalendarDay.kt | 4 ++-- .../crane/calendar/model/CalendarMonth.kt | 4 ++-- .../calendar/model/DatesSelectedState.kt | 4 ++-- .../crane/calendar/model/DaySelected.kt | 4 ++-- .../compose/samples/crane/data/Cities.kt | 4 ++-- .../compose/samples/crane/data/CraneData.kt | 4 ++-- .../samples/crane/data/ExploreModel.kt | 4 ++-- .../samples/crane/details/DetailsActivity.kt | 4 ++-- .../compose/samples/crane/home/CraneHome.kt | 4 ++-- .../samples/crane/home/HomeFeatures.kt | 4 ++-- .../samples/crane/home/LandingScreen.kt | 4 ++-- .../samples/crane/home/MainActivity.kt | 4 ++-- .../samples/crane/home/MainViewModel.kt | 4 ++-- .../samples/crane/home/SearchUserInput.kt | 4 ++-- .../crane/ui/BackdropFrontLayerDraggable.kt | 4 ++-- .../samples/crane/ui/CraneStateDraggable.kt | 4 ++-- .../compose/samples/crane/ui/CraneTheme.kt | 4 ++-- .../compose/samples/crane/ui/Images.kt | 4 ++-- .../compose/samples/crane/ui/Typography.kt | 4 ++-- .../compose/samples/crane/util/Observation.kt | 4 ++-- .../compose/samples/crane/util/Shapes.kt | 4 ++-- Crane/build.gradle | 20 ++++++++++++++-- .../example/crane/buildsrc/Dependencies.kt | 9 +++---- Crane/spotless/copyright.kt | 16 +++++++++++++ 34 files changed, 113 insertions(+), 88 deletions(-) create mode 100644 Crane/spotless/copyright.kt diff --git a/Crane/app/build.gradle b/Crane/app/build.gradle index 0e3d048138..8668f13fba 100644 --- a/Crane/app/build.gradle +++ b/Crane/app/build.gradle @@ -73,10 +73,6 @@ tasks.withType(KotlinCompile).configureEach { } } -configurations { - ktlint -} - dependencies { implementation Libs.Kotlin.stdlib implementation Libs.googleMaps @@ -94,24 +90,4 @@ dependencies { implementation Libs.AndroidX.Lifecycle.extensions implementation Libs.picasso - - ktlint Libs.ktLint } - -task ktlint(type: JavaExec, group: "verification") { - description = "Check Kotlin code style." - main = "com.pinterest.ktlint.Main" - classpath = configurations.ktlint - // Ignoring paren-spacing as it flags a composable type param as an error - args "-F", "src/**/*.kt", "--disabled_rules", "paren-spacing" -} - -check.dependsOn ktlint - -task ktlintFormat(type: JavaExec, group: "formatting") { - description = "Fix Kotlin code style deviations." - main = "com.pinterest.ktlint.Main" - classpath = configurations.ktlint - // Ignoring paren-spacing as it flags a composable type param as an error - args "-F", "src/**/*.kt", "--disabled_rules", "paren-spacing" -} \ No newline at end of file diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/base/BaseUserInput.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/base/BaseUserInput.kt index 9bdec66f62..4c5cbce2ca 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/base/BaseUserInput.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/base/BaseUserInput.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/base/CraneDrawer.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/base/CraneDrawer.kt index 3ecb2d40e7..54fe06e096 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/base/CraneDrawer.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/base/CraneDrawer.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * 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 androidx.compose.samples.crane.base import androidx.compose.Composable diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/base/CraneTabs.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/base/CraneTabs.kt index 9b440a89bf..d9bbc7ae5c 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/base/CraneTabs.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/base/CraneTabs.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/base/ExploreSection.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/base/ExploreSection.kt index 160ae584f6..e57bc8c0d3 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/base/ExploreSection.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/base/ExploreSection.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/base/Scaffold.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/base/Scaffold.kt index 5b371fe434..d950436037 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/base/Scaffold.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/base/Scaffold.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/base/ServiceLocator.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/base/ServiceLocator.kt index 569d1028ab..2dfcf8a247 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/base/ServiceLocator.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/base/ServiceLocator.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/Calendar.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/Calendar.kt index 99f133fd31..2b8fcae98d 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/Calendar.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/Calendar.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/CalendarActivity.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/CalendarActivity.kt index 8a54060965..b6a3211362 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/CalendarActivity.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/CalendarActivity.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/data/CalendarData.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/data/CalendarData.kt index f1195315bb..a50be29834 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/data/CalendarData.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/data/CalendarData.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/CalendarDay.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/CalendarDay.kt index f9cc4ef6e4..7e959f1f07 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/CalendarDay.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/CalendarDay.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/CalendarMonth.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/CalendarMonth.kt index 6ee5976b7b..706e44f62f 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/CalendarMonth.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/CalendarMonth.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/DatesSelectedState.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/DatesSelectedState.kt index 09e5afef01..0d05b0867f 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/DatesSelectedState.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/DatesSelectedState.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/DaySelected.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/DaySelected.kt index 228f501f01..85077cbde4 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/DaySelected.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/model/DaySelected.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/data/Cities.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/data/Cities.kt index ffec4cae7b..9ae8efad83 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/data/Cities.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/data/Cities.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/data/CraneData.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/data/CraneData.kt index 6aef1c3492..27ba5b9135 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/data/CraneData.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/data/CraneData.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/data/ExploreModel.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/data/ExploreModel.kt index baa792625f..02f1f08e66 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/data/ExploreModel.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/data/ExploreModel.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/details/DetailsActivity.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/details/DetailsActivity.kt index 73411c6fbd..5a39c46dcc 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/details/DetailsActivity.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/details/DetailsActivity.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/home/CraneHome.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/home/CraneHome.kt index f06f07664b..f738ea4548 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/home/CraneHome.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/home/CraneHome.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/home/HomeFeatures.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/home/HomeFeatures.kt index 2872c10939..1f2911e137 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/home/HomeFeatures.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/home/HomeFeatures.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/home/LandingScreen.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/home/LandingScreen.kt index 6db655db36..98ca495f00 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/home/LandingScreen.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/home/LandingScreen.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/home/MainActivity.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/home/MainActivity.kt index 8fdac1bd2a..8b6a80c488 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/home/MainActivity.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/home/MainActivity.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/home/MainViewModel.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/home/MainViewModel.kt index 5158de6dea..c325409e1a 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/home/MainViewModel.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/home/MainViewModel.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/home/SearchUserInput.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/home/SearchUserInput.kt index 7495143e3c..daf2c25021 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/home/SearchUserInput.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/home/SearchUserInput.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/BackdropFrontLayerDraggable.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/BackdropFrontLayerDraggable.kt index ffca256c57..1caa7e0da5 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/BackdropFrontLayerDraggable.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/BackdropFrontLayerDraggable.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/CraneStateDraggable.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/CraneStateDraggable.kt index cc319a62b8..d0dbeaf68f 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/CraneStateDraggable.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/CraneStateDraggable.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/CraneTheme.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/CraneTheme.kt index bd122ce323..72816a9b21 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/CraneTheme.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/CraneTheme.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/Images.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/Images.kt index 2501dbbba0..683d644001 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/Images.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/Images.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/Typography.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/Typography.kt index 1a7b93c3c1..d3f3988f7c 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/ui/Typography.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/ui/Typography.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/util/Observation.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/util/Observation.kt index bc4f815df8..cda8a68c37 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/util/Observation.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/util/Observation.kt @@ -1,11 +1,11 @@ /* - * Copyright 2019 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/util/Shapes.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/util/Shapes.kt index 0477bf5e60..bff3d51ccb 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/util/Shapes.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/util/Shapes.kt @@ -1,11 +1,11 @@ /* - * Copyright 2020 Google, Inc. + * Copyright 2020 The Android Open Source Project * * 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 + * 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, diff --git a/Crane/build.gradle b/Crane/build.gradle index 5e0d0493f9..1c94a638fa 100644 --- a/Crane/build.gradle +++ b/Crane/build.gradle @@ -16,6 +16,7 @@ import com.example.crane.buildsrc.Libs import com.example.crane.buildsrc.Urls +import com.example.crane.buildsrc.Versions buildscript { repositories { @@ -29,13 +30,28 @@ buildscript { } } +plugins { + id 'com.diffplug.gradle.spotless' version '4.3.0' +} + subprojects { repositories { google() jcenter() maven { url Urls.kotlinEap } if (Libs.AndroidX.Compose.version.endsWith("SNAPSHOT")) { - maven { url Urls.snapshotUrl } + maven { url Urls.composeSnapshotRepo } + } + } + + apply plugin: 'com.diffplug.gradle.spotless' + spotless { + kotlin { + target '**/*.kt' + targetExclude("$buildDir/**/*.kt") + targetExclude('bin/**/*.kt') + ktlint(Versions.ktLint) + licenseHeaderFile rootProject.file('spotless/copyright.kt') } } -} \ No newline at end of file +} diff --git a/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt b/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt index 25ec39d6a0..bfd3b9d754 100644 --- a/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt +++ b/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt @@ -5,7 +5,7 @@ * 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 + * 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, @@ -64,6 +64,7 @@ object Libs { object Urls { const val kotlinEap = "https://dl.bintray.com/kotlin/kotlin-eap/" - const val snapshotUrl = "https://androidx-dev-prod.appspot.com/snapshots/builds/" + // Dev15 - "${Libs.AndroidX.Compose.snapshot}/artifacts/ui/repository/" -} \ No newline at end of file + const val composeSnapshotRepo = "https://androidx-dev-prod.appspot.com/snapshots/builds/" + + // Dev15 + "${Libs.AndroidX.Compose.snapshot}/artifacts/ui/repository/" +} diff --git a/Crane/spotless/copyright.kt b/Crane/spotless/copyright.kt new file mode 100644 index 0000000000..806db0fb54 --- /dev/null +++ b/Crane/spotless/copyright.kt @@ -0,0 +1,16 @@ +/* + * Copyright $YEAR The Android Open Source Project + * + * 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. + */ +