From 22e44cc190f1c0e286d2ff7cc550ff6a34e83243 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 22 Sep 2021 15:57:24 -0400 Subject: [PATCH] [flutter_plugin_tools] Check licenses in Kotlin The license check overlooked Kotlin, since it's not currently widely used in our repositories. Also adds the missing license to one Kotlin file, from an example that was (likely accidentally) re-generated using Kotlin instead of Java. --- .../main/kotlin/io/flutter/plugins/example/MainActivity.kt | 4 ++++ script/tool/CHANGELOG.md | 1 + script/tool/lib/src/license_check_command.dart | 1 + script/tool/test/license_check_command_test.dart | 1 + 4 files changed, 7 insertions(+) diff --git a/packages/shared_preferences/shared_preferences/example/android/app/src/main/kotlin/io/flutter/plugins/example/MainActivity.kt b/packages/shared_preferences/shared_preferences/example/android/app/src/main/kotlin/io/flutter/plugins/example/MainActivity.kt index 9059dae9e4c4..50cad6f36e24 100644 --- a/packages/shared_preferences/shared_preferences/example/android/app/src/main/kotlin/io/flutter/plugins/example/MainActivity.kt +++ b/packages/shared_preferences/shared_preferences/example/android/app/src/main/kotlin/io/flutter/plugins/example/MainActivity.kt @@ -1,3 +1,7 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + package io.flutter.plugins.example import io.flutter.embedding.android.FlutterActivity diff --git a/script/tool/CHANGELOG.md b/script/tool/CHANGELOG.md index 7e9cd3bec938..3dbbb457fcbe 100644 --- a/script/tool/CHANGELOG.md +++ b/script/tool/CHANGELOG.md @@ -6,6 +6,7 @@ federated packages that have been done in such a way that they will pass in CI, but fail once the change is landed and published. - `publish-check` now validates that there is an `AUTHORS` file. +- `license-check` now validates Kotlin files. ## 0.7.1 diff --git a/script/tool/lib/src/license_check_command.dart b/script/tool/lib/src/license_check_command.dart index 8cee46b45a4c..7165e985c059 100644 --- a/script/tool/lib/src/license_check_command.dart +++ b/script/tool/lib/src/license_check_command.dart @@ -16,6 +16,7 @@ const Set _codeFileExtensions = { '.h', '.html', '.java', + '.kt', '.m', '.mm', '.swift', diff --git a/script/tool/test/license_check_command_test.dart b/script/tool/test/license_check_command_test.dart index 288cf4696a59..5a8a90e9a674 100644 --- a/script/tool/test/license_check_command_test.dart +++ b/script/tool/test/license_check_command_test.dart @@ -66,6 +66,7 @@ void main() { 'html': true, 'java': true, 'json': false, + 'kt': true, 'm': true, 'md': false, 'mm': true,