-
Notifications
You must be signed in to change notification settings - Fork 494
feat: Add lib module with java-library plugin and ahocorasick dependency, and update project build configuration.
#77
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,57 +0,0 @@ | ||
| buildscript { | ||
| repositories { | ||
| jcenter() | ||
| mavenCentral() | ||
| maven { | ||
| url "https://plugins.gradle.org/m2/" | ||
| } | ||
| google() | ||
| } | ||
| dependencies { | ||
| classpath 'com.android.tools.build:gradle:3.5.3' | ||
|
|
||
| classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' | ||
| classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1" | ||
| classpath "gradle.plugin.com.kageiit:lintrules:1.1.2" | ||
| } | ||
| } | ||
|
|
||
| allprojects { | ||
| repositories { | ||
| jcenter() | ||
| mavenCentral() | ||
| mavenLocal() | ||
| google() | ||
| } | ||
| } | ||
|
|
||
|
|
||
| ext { | ||
| userName = 'PromeG' | ||
| developer = [ | ||
| id : 'promeg', | ||
| name : 'promeg', | ||
| email: 'gyacong@gmail.com' | ||
| ] | ||
| license = [ | ||
| id : 'MIT', | ||
| name: 'The MIT License (MIT)', | ||
| url : 'http://opensource.org/licenses/MIT' | ||
| ] | ||
| groupName = 'com.github.promeg' | ||
| artifactName = 'TinyPinyin' | ||
| artifactDescription = '适用于Java和Android的快速、低内存占用的汉字转拼音库。' | ||
| artifactLabels = ['pinyin', 'java', 'android'] | ||
|
|
||
|
|
||
| groupName = 'com.github.promeg' | ||
| releaseVersionName = "3.0.0" | ||
| releaseVersionCode = 6 | ||
|
|
||
| // Android | ||
| androidBuildToolsVersion = '24.0.3' | ||
| androidMinSdkVersion = 16 | ||
| androidTargetSdkVersion = 24 | ||
| androidCompileSdkVersion = 24 | ||
| androidSupportSdkVersion = '24.2.1' | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,137 +1,9 @@ | ||||||||||||
| import java.text.SimpleDateFormat | ||||||||||||
|
|
||||||||||||
| apply plugin: 'java' | ||||||||||||
| apply plugin: 'me.champeau.gradle.jmh' | ||||||||||||
| apply plugin: 'maven-publish' | ||||||||||||
| apply plugin: 'com.jfrog.bintray' | ||||||||||||
| //apply from: '../config/quality-java.gradle' | ||||||||||||
|
|
||||||||||||
| tasks.withType(JavaCompile) { | ||||||||||||
| options.encoding = 'UTF-8' | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| javadoc { | ||||||||||||
| options.encoding = 'UTF-8' | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| group = rootProject.ext.groupName | ||||||||||||
| version = rootProject.ext.releaseVersionName | ||||||||||||
|
|
||||||||||||
| buildscript { | ||||||||||||
| repositories { | ||||||||||||
| mavenLocal() | ||||||||||||
| mavenCentral() | ||||||||||||
| jcenter() | ||||||||||||
| maven { | ||||||||||||
| url "https://plugins.gradle.org/m2/" | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| dependencies { | ||||||||||||
| classpath "me.champeau.gradle:jmh-gradle-plugin:0.5.0" | ||||||||||||
| classpath 'org.apache.ant:ant:1.9.7' | ||||||||||||
| } | ||||||||||||
| apply plugin: 'java-library' | ||||||||||||
|
|
||||||||||||
| repositories { | ||||||||||||
| mavenCentral() | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| sourceCompatibility = 1.6 | ||||||||||||
| targetCompatibility = 1.6 | ||||||||||||
|
|
||||||||||||
| jmh { | ||||||||||||
| jmhVersion = '1.21' | ||||||||||||
| include = ['PinyinDictBenchmark.*', 'PinyinSampleBenchmark.*'] | ||||||||||||
| operationsPerInvocation = 10 | ||||||||||||
| benchmarkMode = ['thrpt'] | ||||||||||||
| verbosity = 'NORMAL' | ||||||||||||
| fork = 2 | ||||||||||||
| timeUnit = 'us' | ||||||||||||
| duplicateClassesStrategy = 'warn' | ||||||||||||
| jvmArgs = ['-Djmh.separateClasspathJAR=true'] | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| dependencies { | ||||||||||||
| testImplementation 'junit:junit:4.12' | ||||||||||||
| testImplementation 'org.hamcrest:hamcrest-all:1.3' | ||||||||||||
| testImplementation 'org.assertj:assertj-core:1.7.1' | ||||||||||||
| testImplementation 'org.mockito:mockito-core:1.10.19' | ||||||||||||
| testImplementation 'com.belerweb:pinyin4j:2.5.0' | ||||||||||||
|
|
||||||||||||
| implementation 'org.ahocorasick:ahocorasick:0.3.0' | ||||||||||||
|
||||||||||||
| 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' |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,2 @@ | ||||||
| include ':tinypinyin-lexicons-android-cncity', ':tinypinyin-lexicons-java-cncity', | ||||||
| ':android-sample', | ||||||
| ':tinypinyin-android-asset-lexicons' | ||||||
| rootProject.name = 'tinypinyin' | ||||||
| include 'lib' | ||||||
|
||||||
| include 'lib' | |
| include 'lib', 'android-sample', 'tinypinyin-lexicons-android-cncity', 'tinypinyin-android-asset-lexicons', 'tinypinyin-lexicons-java-cncity' |
There was a problem hiding this comment.
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/targetCompatibilityconfiguration (previously 1.6) for the corelibmodule. 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-cncitysets both to 1.6).