diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4fe14f28d..2c6697488 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -47,6 +47,10 @@ jobs: - name: Install NDK run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;22.0.7026061" --sdk_root=${ANDROID_SDK_ROOT} + - name: Building Kotlin Report + run: bash contrib/kotlin-validator.sh + + - name: Build all configurations run: ./gradlew assemble diff --git a/contrib/kotlin-validator.sh b/contrib/kotlin-validator.sh new file mode 100644 index 000000000..be666b529 --- /dev/null +++ b/contrib/kotlin-validator.sh @@ -0,0 +1,49 @@ +# +# Kiwix Android +# Copyright (c) 2022 Kiwix +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# + + #!/usr/bin/env bash + + # + # Kiwix Android + # Copyright (c) 2022 Kiwix + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation, either version 3 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + # + # + + if ./gradlew buildKotlinToolingMetadata; then + version=$(cat app/build/kotlinToolingMetadata/kotlin-tooling-metadata.json | tr { '\n' | tr , '\n' | tr } '\n' | grep "buildPluginVersion" | awk -F'"' '{print $4}') + if [ $version == "1.7.0" ]; + then + echo "Build System is using kotlin version 1.7.0" + else + exit 1 + fi + else + exit 1 + fi