Skip to content

feat: Add lib module with java-library plugin and ahocorasick dependency, and update project build configuration.#77

Open
mertcaners12 wants to merge 1 commit into
promeG:masterfrom
mertcaners12:master
Open

feat: Add lib module with java-library plugin and ahocorasick dependency, and update project build configuration.#77
mertcaners12 wants to merge 1 commit into
promeG:masterfrom
mertcaners12:master

Conversation

@mertcaners12

Copy link
Copy Markdown

No description provided.

…ependency, and update project build configuration.
Copilot AI review requested due to automatic review settings March 8, 2026 21:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR restructures the Gradle build to focus on a lib Java library module using the java-library plugin, and adds the org.ahocorasick:ahocorasick dependency as part of that module’s build configuration.

Changes:

  • Simplifies settings.gradle to include only the lib module.
  • Replaces lib/build.gradle with a minimal java-library setup and adds the ahocorasick dependency.
  • Removes the root build.gradle buildscript/ext configuration (resulting in an empty root build file).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
settings.gradle Reduces the multi-project build to only include lib.
lib/build.gradle Switches to java-library, adds Maven Central, and declares the ahocorasick dependency.
build.gradle Removes prior root buildscript/ext configuration (file becomes empty).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread settings.gradle
':android-sample',
':tinypinyin-android-asset-lexicons'
rootProject.name = 'tinypinyin'
include 'lib'

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

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

settings.gradle now only includes the lib module, but the repository still contains android-sample, tinypinyin-lexicons-android-cncity, tinypinyin-android-asset-lexicons, and tinypinyin-lexicons-java-cncity. CI/docs currently run Gradle tasks against those projects (e.g., .travis.yml and README), so Gradle will fail with “Project '…' not found”. Either re-add the includes for these modules, or update/remove the CI and documentation tasks and any inter-module project() dependencies to match the new single-module build.

Suggested change
include 'lib'
include 'lib', 'android-sample', 'tinypinyin-lexicons-android-cncity', 'tinypinyin-android-asset-lexicons', 'tinypinyin-lexicons-java-cncity'

Copilot uses AI. Check for mistakes.
Comment thread lib/build.gradle
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'com.belerweb:pinyin4j:2.5.0'

implementation 'org.ahocorasick:ahocorasick:0.3.0'

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

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

lib has an extensive src/test/java suite that imports JUnit, Hamcrest, and Pinyin4J, but this build.gradle no longer declares any testImplementation dependencies. As a result, :lib:test (and ./gradlew build) will fail to compile tests. Please add the required test dependencies back (at least JUnit 4, a Hamcrest artifact that provides org.hamcrest.Matchers, and Pinyin4J for PinyinTest).

Suggested change
implementation 'org.ahocorasick:ahocorasick:0.3.0'
implementation 'org.ahocorasick:ahocorasick:0.3.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'com.belerweb:pinyin4j:2.5.1'

Copilot uses AI. Check for mistakes.
Comment thread lib/build.gradle
classpath 'org.apache.ant:ant:1.9.7'
}
apply plugin: 'java-library'

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

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

This change removes the explicit sourceCompatibility/targetCompatibility configuration (previously 1.6) for the core lib module. That will change the produced bytecode level to whatever the build JDK defaults to, and can break consumers that expect Java 6/7-compatible artifacts (notably the Android-related subprojects in this repo). Please pin the compatibility level explicitly to match the rest of the project’s Gradle modules (e.g., tinypinyin-lexicons-java-cncity sets both to 1.6).

Suggested change
sourceCompatibility = 1.6
targetCompatibility = 1.6

Copilot uses AI. Check for mistakes.
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