Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use convention plugins instead of script plugins #87

Merged
merged 9 commits into from
Mar 26, 2024

Conversation

jmatsu
Copy link
Contributor

@jmatsu jmatsu commented Mar 25, 2024

ref: #86 (but not close)

I'm planning to create a code-generation tool as a Gradle plugin, which should be robust for future updates of AGP and/or Gradle. I'm expecting the implementation of the code-generation tool would be so huge, so we need readability and maintainability of the tool's code. However, script plugins are not so readable for huge codebase and it's not unrealistic to create a new repository to maintain plugins for this repo. That's why we need convention plugins.

@jmatsu jmatsu marked this pull request as ready for review March 25, 2024 09:58
@@ -46,8 +65,6 @@ jobs:
--url 'https://deploygate.com/api/users/${{ secrets.SHARED_DEPLOYGATE_APP_OWNER_NAME_FOR_PUBLIC_REPO }}/apps' | \
jq -r '"\(.results.package_name) \(.results.distribution.url)"'
done < <(find ./sample/build/outputs/bundle -name "*.aab")
- name: Check javadocs
run: ./gradlew sdk:generateJavadocForReleasePublication sdkMock:generateJavadocForReleasePublication
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same verifications will be done in the build-sdk job above.

android.useAndroidX=true
android.disableAutomaticComponentCreation=true
Copy link
Contributor Author

@jmatsu jmatsu Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default from AGP8. Currently, it's 7.

abortOnError = false
}

publishing {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New DSL allows us to remove Javadoc related task declarations!

readonly artifact_id="$(jq -r '.component.module' "${module_name}/build/publications/release/module.json")"
readonly version="$(jq -r '.component.version' "${module_name}/build/publications/release/module.json")"

cat<<EOF > "${tmp_dir}/expected.txt"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if all artifacts, which are javadoc, sources, and runtime, exist.

import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.dependencies

class SdkPlugin : Plugin<Project> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from sdk.build.gradle

import org.gradle.plugins.signing.SigningExtension
import java.util.Locale

class MavenPublishPlugin : Plugin<Project> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from publishing.build.gradle

@jmatsu jmatsu requested a review from satsukies March 25, 2024 10:21
Copy link
Member

@satsukies satsukies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmatsu
Copy link
Contributor Author

jmatsu commented Mar 26, 2024

Thanks~

@jmatsu jmatsu merged commit 1c924bf into master Mar 26, 2024
6 checks passed
@jmatsu jmatsu deleted the jmatsu/feat/convention_plugin branch March 26, 2024 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants