Browse Source

先这么处理下黄色警告.

nieqiurong 6 years ago
parent
commit
1a92df7d01

+ 8 - 16
build.gradle

@@ -22,7 +22,7 @@ ext {
         jsqlparserVersion = '1.3',
     ]
 
-    dependencies = [
+    lib = [
         "kotlin-reflect"                    : "org.jetbrains.kotlin:kotlin-reflect:1.3.10",
         "kotlin-stdlib-jdk8"                : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.10",
         "jsqlparser"                        : "com.github.jsqlparser:jsqlparser:${jsqlparserVersion}",
@@ -55,7 +55,7 @@ ext {
         "commons-dbcp2"                     : "org.apache.commons:commons-dbcp2:2.1.1",
         "sqlserver"                         : "com.microsoft.sqlserver:sqljdbc4:4.0",
         "postgresql"                        : "org.postgresql:postgresql:9.4.1212",
-        "oracle"                            : fileTree(dir: 'libs', includes: ['ojdbc-11.2.0.3-jdk16.jar']),
+        "oracle"                            :  fileTree(dir: 'libs', includes: ['ojdbc-11.2.0.3-jdk16.jar']),
         "h2"                                : "com.h2database:h2:1.4.194",
         "mysql"                             : "mysql:mysql-connector-java:5.1.38",
         //code generator
@@ -102,12 +102,12 @@ subprojects {
     }
 
     dependencies {
-        annotationProcessor rootProject.ext.dependencies["lombok"]
-        implementation rootProject.ext.dependencies["lombok"]
-        testAnnotationProcessor rootProject.ext.dependencies["lombok"]
-        testCompileOnly rootProject.ext.dependencies["lombok"]
-        testCompile rootProject.ext.dependencies["mockito-all"]
-        testCompile rootProject.ext.dependencies["junit"]
+        annotationProcessor lib.lombok as String
+        implementation lib.lombok as String
+        testAnnotationProcessor lib.lombok as String
+        testCompileOnly lib.lombok as String
+        testCompile lib."mockito-all" as String
+        testCompile lib.junit as String
     }
 
     task sourcesJar(type: Jar, dependsOn: classes) {
@@ -144,14 +144,6 @@ subprojects {
         }
     }
 
-    /*
-     * 1.修改 gradle.properties 中 signing.secretKeyRingFile的路径
-     * 2.执行 gradle clean build publish -Dun=用户名 -Dps=密码 -x test
-     * ---------------------------wrapper------------------------------------------
-     * 先执行 gradle wrapper 生成 gradlew 和 gradlew.bat
-     * win: gradlew.bat clean build publish -Dun=用户名 -Dps=密码 -x test
-     * mac: ./gradlew clean build publish -Dun=用户名 -Dps=密码 -x test
-     */
     publishing {
 
         repositories {

+ 14 - 12
mybatis-plus-core/build.gradle

@@ -1,19 +1,21 @@
 dependencies {
     api project(":mybatis-plus-annotation")
-    api rootProject.ext.dependencies["mybatis"]
-    api rootProject.ext.dependencies["jsqlparser"]
+    api lib.mybatis as String
+    api lib.jsqlparser as String
 
-    implementation rootProject.ext.dependencies["cglib"]
-    implementation rootProject.ext.dependencies["spring-aop"]
 
-    testCompile rootProject.ext.dependencies["mybatis-ehcache"]
-    testCompile rootProject.ext.dependencies["logback-classic"]
-    testCompile(rootProject.ext.dependencies["commons-dbcp2"]) {
+    implementation lib.cglib as String
+    implementation lib."spring-aop" as String
+
+    testCompile lib."mybatis-ehcache" as String
+    testCompile lib."logback-classic" as String
+    //noinspection GroovyAssignabilityCheck
+    testCompile(lib.'commons-dbcp2') {
         exclude module: "commons-logging"
     }
-    testCompile rootProject.ext.dependencies["aspectjweaver"]
-    testCompile rootProject.ext.dependencies["hikaricp"]
-    testCompile rootProject.ext.dependencies["druid"]
-    testCompile rootProject.ext.dependencies["fastjson"]
-    testCompile rootProject.ext.dependencies["tomcatjdbc"]
+    testCompile lib.aspectjweaver as String
+    testCompile lib.hikaricp as String
+    testCompile lib.druid as String
+    testCompile lib.fastjson as String
+    testCompile lib.tomcatjdbc as String
 }

+ 20 - 20
mybatis-plus-extension/build.gradle

@@ -1,28 +1,28 @@
 apply plugin: 'org.jetbrains.kotlin.jvm'
 dependencies {
     api project(":mybatis-plus-core")
-    api rootProject.ext.dependencies["mybatis-spring"]
-    api rootProject.ext.dependencies["mybatis"]
+    api lib."mybatis-spring" as String
+    api lib.mybatis as String
 
-    implementation rootProject.ext.dependencies["kotlin-stdlib-jdk8"]
-    implementation rootProject.ext.dependencies["kotlin-reflect"]
-    implementation rootProject.ext.dependencies["spring-context-support"]
-    implementation rootProject.ext.dependencies["spring-jdbc"]
-    implementation rootProject.ext.dependencies["slf4j-api"]
+    implementation lib."kotlin-stdlib-jdk8" as String
+    implementation lib."kotlin-reflect" as String
+    implementation lib."spring-context-support" as String
+    implementation lib."spring-jdbc" as String
+    implementation lib."slf4j-api" as String
 
-    testCompile rootProject.ext.dependencies["spring-web"]
-    testCompile rootProject.ext.dependencies["javax.servlet-api"]
-    testCompile rootProject.ext.dependencies["spring-test"]
-    testCompile rootProject.ext.dependencies["fastjson"]
+    testCompile lib."spring-web" as String
+    testCompile lib."javax.servlet-api" as String
+    testCompile lib."spring-test" as String
+    testCompile lib.fastjson as String
 
-    testCompile rootProject.ext.dependencies["hikaricp"]
-    testCompile rootProject.ext.dependencies["commons-dbcp2"]
-    testCompile rootProject.ext.dependencies["druid"]
-    testCompile rootProject.ext.dependencies["tomcatjdbc"]
+    testCompile lib.hikaricp as String
+    testCompile lib."commons-dbcp2" as String
+    testCompile lib.druid as String
+    testCompile lib.tomcatjdbc as String
 
-    testCompile rootProject.ext.dependencies["h2"]
-    testCompile rootProject.ext.dependencies["sqlserver"]
-    testCompile rootProject.ext.dependencies["postgresql"]
-    testCompile rootProject.ext.dependencies["oracle"]
-    testCompile rootProject.ext.dependencies["mysql"]
+    testCompile lib.h2 as String
+    testCompile lib.sqlserver as String
+    testCompile lib.postgresql as String
+    testCompile lib.oracle as ConfigurableFileTree
+    testCompile lib.mysql as String
 }

+ 9 - 9
mybatis-plus-generator/build.gradle

@@ -1,14 +1,14 @@
 dependencies {
     api project(":mybatis-plus-extension")
 
-    implementation rootProject.ext.dependencies["velocity"]
-    implementation rootProject.ext.dependencies["freemarker"]
-    implementation rootProject.ext.dependencies["beetl"]
+    implementation lib.velocity as String
+    implementation lib.freemarker as String
+    implementation lib.beetl as String
 
-    testCompile rootProject.ext.dependencies["sqlserver"]
-    testCompile rootProject.ext.dependencies["postgresql"]
-    testCompile rootProject.ext.dependencies["oracle"]
-    testCompile rootProject.ext.dependencies["h2"]
-    testCompile rootProject.ext.dependencies["mysql"]
-    testCompile rootProject.ext.dependencies["logback-classic"]
+    testCompile lib.sqlserver as String
+    testCompile lib.postgresql as String
+    testCompile lib.oracle as ConfigurableFileTree
+    testCompile lib.h2 as String
+    testCompile lib.mysql as String
+    testCompile lib."logback-classic" as String
 }

+ 17 - 17
mybatis-plus/build.gradle

@@ -2,25 +2,25 @@ dependencies {
     api project(":mybatis-plus-extension")
     implementation project(":mybatis-plus-generator")
 
-    testCompile rootProject.ext.dependencies["spring-web"]
-    testCompile rootProject.ext.dependencies["javax.servlet-api"]
+    testCompile lib."spring-web" as String
+    testCompile lib."javax.servlet-api" as String
 
-    testCompile rootProject.ext.dependencies["spring-test"]
-    testCompile rootProject.ext.dependencies["fastjson"]
+    testCompile lib."spring-test" as String
+    testCompile lib.fastjson as String
 
-    testCompile rootProject.ext.dependencies["hikaricp"]
-    testCompile rootProject.ext.dependencies["commons-dbcp2"]
-    testCompile rootProject.ext.dependencies["druid"]
-    testCompile rootProject.ext.dependencies["tomcatjdbc"]
+    testCompile lib.hikaricp as String
+    testCompile lib."commons-dbcp2" as String
+    testCompile lib.druid as String
+    testCompile lib.tomcatjdbc as String
 
-    testCompile rootProject.ext.dependencies["h2"]
-    testCompile rootProject.ext.dependencies["sqlserver"]
-    testCompile rootProject.ext.dependencies["postgresql"]
-    testCompile rootProject.ext.dependencies["oracle"]
-    testCompile rootProject.ext.dependencies["mysql"]
-    testCompile rootProject.ext.dependencies["jackson"]
-    testCompile rootProject.ext.dependencies["logback-classic"]
+    testCompile lib.h2 as String
+    testCompile lib.sqlserver as String
+    testCompile lib.postgresql as String
+    testCompile lib.oracle as ConfigurableFileTree
+    testCompile lib.mysql as String
+    testCompile lib.jackson as String
+    testCompile lib."logback-classic" as String
 
-    testCompile rootProject.ext.dependencies["spring-context-support"]
-    testCompile rootProject.ext.dependencies["spring-jdbc"]
+    testCompile lib."spring-context-support" as String
+    testCompile lib."spring-jdbc" as String
 }