소스 검색

去除optional-base,provided-base插件,升级java插件至java-library.

nieqiurong 6 년 전
부모
커밋
0e9f84c7e4
6개의 변경된 파일37개의 추가작업 그리고 31개의 파일을 삭제
  1. 11 8
      build.gradle
  2. 4 4
      mybatis-plus-boot-starter/build.gradle
  3. 5 5
      mybatis-plus-core/build.gradle
  4. 8 8
      mybatis-plus-extension/build.gradle
  5. 4 4
      mybatis-plus-generator/build.gradle
  6. 5 2
      mybatis-plus/build.gradle

+ 11 - 8
build.gradle

@@ -79,11 +79,9 @@ description = "Mybatis 增强工具包 - 只做增强不做改变,简化CRUD
 
 subprojects {
 
-    apply plugin: 'java'
+    apply plugin: 'java-library'
     apply plugin: 'signing'
     apply plugin: 'maven-publish'
-    apply plugin: 'nebula.optional-base'
-    apply plugin: 'nebula.provided-base'
 
     sourceCompatibility = "${javaVersion}"
     targetCompatibility = "${javaVersion}"
@@ -110,7 +108,7 @@ subprojects {
 
     dependencies {
         annotationProcessor rootProject.ext.dependencies["lombok"]
-        provided 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"]
@@ -211,12 +209,17 @@ subprojects {
                     }
 
                     withXml {
-                        asNode().dependencies.'*'.findAll() {
-                            it.scope.text() == 'compile' && project.configurations.provided.allDependencies.find { dep ->
+                        def root = asNode()
+                        root.dependencies.'*'.findAll {
+                            def d = it
+                            d.scope.text() == 'runtime' && project.configurations.findByName("implementation").allDependencies.find { dep ->
                                 dep.name == it.artifactId.text()
+                            }.each() {
+                                d.scope*.value = 'provided'
+                                if(d.artifactId.text() != 'lombok'){
+                                    d.appendNode('optional', true)
+                                }
                             }
-                        }.each() {
-                            it.scope*.value = 'provided'
                         }
                     }
                 }

+ 4 - 4
mybatis-plus-boot-starter/build.gradle

@@ -1,6 +1,6 @@
 dependencies {
-    compile project(":mybatis-plus")
-    compile rootProject.ext.dependencies["springboot-autoconfigure"]
-    compile rootProject.ext.dependencies["springboot-starter-jdbc"]
-    compile rootProject.ext.dependencies["springboot-configuration-processor"], optional
+    api project(":mybatis-plus")
+    api rootProject.ext.dependencies["springboot-autoconfigure"]
+    api rootProject.ext.dependencies["springboot-starter-jdbc"]
+    implementation rootProject.ext.dependencies["springboot-configuration-processor"]
 }

+ 5 - 5
mybatis-plus-core/build.gradle

@@ -1,10 +1,10 @@
 dependencies {
-    compile project(":mybatis-plus-annotation")
-    compile rootProject.ext.dependencies["mybatis"]
-    compile rootProject.ext.dependencies["jsqlparser"]
+    api project(":mybatis-plus-annotation")
+    api rootProject.ext.dependencies["mybatis"]
+    api rootProject.ext.dependencies["jsqlparser"]
 
-    compile rootProject.ext.dependencies["cglib"], optional
-    compile rootProject.ext.dependencies["spring-aop"], optional
+    implementation rootProject.ext.dependencies["cglib"]
+    implementation rootProject.ext.dependencies["spring-aop"]
 
     testCompile rootProject.ext.dependencies["mybatis-ehcache"]
     testCompile rootProject.ext.dependencies["logback-classic"]

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

@@ -1,14 +1,14 @@
 apply plugin: 'org.jetbrains.kotlin.jvm'
 dependencies {
-    compile project(":mybatis-plus-core")
-    compile rootProject.ext.dependencies["mybatis-spring"]
-    compile rootProject.ext.dependencies["mybatis"]
+    api project(":mybatis-plus-core")
+    api rootProject.ext.dependencies["mybatis-spring"]
+    api rootProject.ext.dependencies["mybatis"]
 
-    compile rootProject.ext.dependencies["kotlin-stdlib-jdk8"], optional
-    compile rootProject.ext.dependencies["kotlin-reflect"], optional
-    compile rootProject.ext.dependencies["spring-context-support"], optional
-    compile rootProject.ext.dependencies["spring-jdbc"], optional
-    compile rootProject.ext.dependencies["slf4j-api"], optional
+    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"]
 
     testCompile rootProject.ext.dependencies["spring-web"]
     testCompile rootProject.ext.dependencies["javax.servlet-api"]

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

@@ -1,9 +1,9 @@
 dependencies {
-    compile project(":mybatis-plus-extension")
+    api project(":mybatis-plus-extension")
 
-    compile rootProject.ext.dependencies["velocity"], optional
-    compile rootProject.ext.dependencies["freemarker"], optional
-    compile rootProject.ext.dependencies["beetl"], optional
+    implementation rootProject.ext.dependencies["velocity"]
+    implementation rootProject.ext.dependencies["freemarker"]
+    implementation rootProject.ext.dependencies["beetl"]
 
     testCompile rootProject.ext.dependencies["sqlserver"]
     testCompile rootProject.ext.dependencies["postgresql"]

+ 5 - 2
mybatis-plus/build.gradle

@@ -1,6 +1,6 @@
 dependencies {
-    compile project(":mybatis-plus-extension")
-    compile project(":mybatis-plus-generator"), optional
+    api project(":mybatis-plus-extension")
+    implementation project(":mybatis-plus-generator")
 
     testCompile rootProject.ext.dependencies["spring-web"]
     testCompile rootProject.ext.dependencies["javax.servlet-api"]
@@ -20,4 +20,7 @@ dependencies {
     testCompile rootProject.ext.dependencies["mysql"]
     testCompile rootProject.ext.dependencies["jackson"]
     testCompile rootProject.ext.dependencies["logback-classic"]
+
+    testCompile rootProject.ext.dependencies["spring-context-support"]
+    testCompile rootProject.ext.dependencies["spring-jdbc"]
 }