-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83d0810
commit 02fadb5
Showing
43 changed files
with
3,691 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
buildscript { | ||
ext.kotlin_version = '1.3.61' | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
|
||
plugins { | ||
id 'java' | ||
id 'org.jetbrains.intellij' version '0.4.15' | ||
id 'org.jetbrains.kotlin.jvm' version '1.3.21' | ||
} | ||
def pluginVersionSuffix = ideaVersionPrefix != '' ? '-' + ideaVersionPrefix : '' | ||
|
||
apply plugin: 'idea' | ||
apply plugin: 'kotlin' | ||
apply plugin: 'org.jetbrains.intellij' | ||
|
||
group 'org.ruiyu' | ||
version (pluginVersion + pluginVersionSuffix) | ||
|
||
sourceCompatibility = 1.8 | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
sourceSets { | ||
main.java.srcDirs = [ | ||
"src/main/java", | ||
"gen", | ||
"third_party/vmServiceDrivers", | ||
"src/main/resources" | ||
] | ||
test { | ||
java { | ||
srcDirs = [ | ||
"gen", | ||
"src/main/java", | ||
"testSrc/unit", | ||
"third_party/vmServiceDrivers" | ||
] | ||
} | ||
resources { | ||
srcDirs = [ | ||
"resources", | ||
"src", | ||
"testData/unit", | ||
"testSrc/unit" | ||
] | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} | ||
} | ||
|
||
dependencies { | ||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' | ||
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" | ||
// compile 'com.alibaba:fastjson:1.2.61' | ||
implementation 'org.yaml:snakeyaml:1.21' | ||
testCompile group: 'junit', name: 'junit', version: '4.12' | ||
} | ||
|
||
// See https://github.com/JetBrains/gradle-intellij-plugin/ | ||
intellij { | ||
//不光此处要添加,还要在plugin.xml添加依赖 不然会报类找不到 | ||
// plugins = ['android', 'Kotlin', 'gradle', "Dart:${dartVersion}", 'io.flutter:42.1.4'] | ||
pluginName 'Flutter i18n' | ||
|
||
def requiredPlugins = ['yaml'] | ||
|
||
// Starting with 2019.2, JetBrains extracted the Java functionality into its own plugin | ||
// so we have to check which plugins to load as build will fail when compiling for older IDE. | ||
// See: https://blog.jetbrains.com/platform/2019/06/java-functionality-extracted-as-a-plugin/ | ||
if (ideaVersionPrefix != '' && ideaVersionPrefix.toInteger() >= 192) { | ||
requiredPlugins.add('java') | ||
} | ||
|
||
plugins = requiredPlugins | ||
} | ||
|
||
patchPluginXml { | ||
version (pluginVersion + pluginVersionSuffix) | ||
} | ||
|
||
publishPlugin { | ||
token = System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken") | ||
} | ||
|
||
def productMatrixFile = 'product-matrix.json' | ||
def jsonFile = new File(productMatrixFile) | ||
if (jsonFile == null) { | ||
// noinspection GroovyAssignabilityCheck | ||
throw new GradleException("Unable to read $productMatrixFile, is it missing?") | ||
} | ||
|
||
// Fail if the product details file isn't found. | ||
// noinspection UnnecessaryQualifiedReference | ||
def productMatrix = new groovy.json.JsonSlurper().parseText(jsonFile.text) | ||
if (productMatrix == null || !(productMatrix instanceof Map)) { | ||
// noinspection GroovyAssignabilityCheck | ||
throw new GradleException("Unable to read $productMatrixFile.") | ||
} | ||
|
||
// If an ideaVersionPrefix is provided, search for the first matched product and use that. | ||
if (ideaVersionPrefix != '') { | ||
def productMatrixKeys = productMatrix.keySet() as String[] | ||
for (productMatrixKey in productMatrixKeys) { | ||
if (productMatrixKey != null && productMatrixKey.startsWith("${ideaVersionPrefix}.")) { | ||
ideaVersion = productMatrixKey | ||
break | ||
} | ||
} | ||
} | ||
|
||
// Fail if requested version is unsupported. | ||
if (!productMatrix.containsKey(ideaVersion)) { | ||
// noinspection GroovyAssignabilityCheck | ||
throw new GradleException("Requested IDEA version is unsupported: $ideaVersion") | ||
} | ||
|
||
// Determine which branch we're building for. | ||
def productDetails = productMatrix[ideaVersion] | ||
if (productDetails == null || !(productDetails instanceof Map)) { | ||
// noinspection GroovyAssignabilityCheck | ||
throw new GradleException("Product details for IDEA version $ideaVersion is missing or invalid.") | ||
} | ||
|
||
// Adjust plugin's output file name. | ||
rootProject.setBuildDir("${rootProject.buildDir}/${productDetails.comments}") | ||
|
||
|
||
System.out.println( | ||
"\nBuilding plugin ${(pluginVersion + pluginVersionSuffix)} for IDEA " + | ||
"version $ideaVersion (branch ${productDetails.comments})\n" | ||
) | ||
System.out.println("Since: ${productDetails.sinceBuild}") | ||
System.out.println("Until: ${productDetails.untilBuild}") | ||
System.out.println("Dart: ${productDetails.dartPluginVersion}") | ||
System.out.println("Flutter: ${productDetails.flutterPluginVersion}\n") | ||
System.out.println("Artifacts output directory: ${rootProject.buildDir}\n") | ||
|
||
// Adjust plugin build settings. | ||
intellij.version = ideaVersion | ||
intellij.plugins += "Dart:${productDetails.dartPluginVersion}" | ||
intellij.plugins += "io.flutter:${productDetails.flutterPluginVersion}" | ||
intellij.plugins += "Kotlin" | ||
patchPluginXml.sinceBuild = productDetails.sinceBuild | ||
patchPluginXml.untilBuild = productDetails.untilBuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kotlin_version=1.3.61 | ||
pluginVersion=3.1.1 | ||
#每次修改这里去打包 | ||
ideaVersionPrefix=191 | ||
ideaVersion= |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Sun Dec 22 14:38:49 CST 2019 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
Oops, something went wrong.