Browse Source

Revert "囍迎 2018 MP 2.1.8 发布"

This reverts commit 4c9acc7
聂秋荣 7 years ago
parent
commit
998bcc1daa
4 changed files with 202 additions and 181 deletions
  1. 163 137
      build.gradle
  2. 27 31
      mybatis-plus-core/build.gradle
  3. 8 9
      mybatis-plus-generate/build.gradle
  4. 4 4
      mybatis-plus-support/build.gradle

+ 163 - 137
build.gradle

@@ -1,150 +1,176 @@
 ext {
-    configuration = [
-            javaVersion = JavaVersion.VERSION_1_7
-    ]
-
-    libraries = [
-            mybatisSpringVersion = '1.3.1',
-            mybatisVersion = '3.4.5',
-            springVersion = '4.3.5.RELEASE',
-    ]
-
-    dependencies = [
-            "jsqlparser": "com.github.jsqlparser:jsqlparser:1.1",
-            "mybatis-spring": "org.mybatis:mybatis-spring:${mybatisSpringVersion}",
-            "mybatis": "org.mybatis:mybatis:${mybatisVersion}",
-            "velocity":"org.apache.velocity:velocity-engine-core:2.0",
-            "slf4j-api":"org.slf4j:slf4j-api:1.7.25",
-            "junit":"junit:junit:4.12",
-            "commons-dbcp2":"org.apache.commons:commons-dbcp2:2.1.1",
-            "mybatis-ehcache":"org.mybatis.caches:mybatis-ehcache:1.1.0",
-            "logback-classic":"ch.qos.logback:logback-classic:1.2.2",
-            "sqlserver":"com.microsoft.sqlserver:sqljdbc4:4.0",
-            "postgresql":"org.postgresql:postgresql:9.4.1212",
-            "oracle":"com.oracle:ojdbc14:10.2.0.5.0",
-            "h2":"com.h2database:h2:1.4.194",
-            "mysql":"mysql:mysql-connector-java:5.1.38",
-            "aspectjweaver":"org.aspectj:aspectjweaver:1.8.9",
-            "servlet-api":"javax.servlet:servlet-api:2.5",
-            "lombok":"org.projectlombok:lombok:1.16.16",
-            "hikaricp":"com.zaxxer:HikariCP:2.7.0",
-            "spring-test":"org.springframework:spring-test:${springVersion}",
-            "spring-webmvc":"org.springframework:spring-webmvc:${springVersion}",
-            "spring-context-support":"org.springframework:spring-context-support:${springVersion}",
-            "spring-jdbc":"org.springframework:spring-jdbc:${springVersion}",
-            "spring-tx":"org.springframework:spring-tx:${springVersion}",
-            "druid":"com.alibaba:druid:1.0.29",
-            "fastjson":"com.alibaba:fastjson:1.2.37"
-    ]
+	configuration = [
+			javaVersion = JavaVersion.VERSION_1_7
+	]
+
+	libraries = [
+			mybatisSpringVersion = '1.3.1',
+			mybatisVersion = '3.4.5',
+			springVersion = '4.3.5.RELEASE',
+	]
+
+	dependencies = [
+			"jsqlparser": "com.github.jsqlparser:jsqlparser:1.1",
+			"mybatis-spring": "org.mybatis:mybatis-spring:${mybatisSpringVersion}",
+			"mybatis": "org.mybatis:mybatis:${mybatisVersion}",
+			"velocity":"org.apache.velocity:velocity-engine-core:2.0",
+			"slf4j-api":"org.slf4j:slf4j-api:1.7.25",
+			"junit":"junit:junit:4.12",
+			"commons-dbcp2":"org.apache.commons:commons-dbcp2:2.1.1",
+			"mybatis-ehcache":"org.mybatis.caches:mybatis-ehcache:1.1.0",
+			"logback-classic":"ch.qos.logback:logback-classic:1.2.2",
+			"sqlserver":"com.microsoft.sqlserver:sqljdbc4:4.0",
+			"postgresql":"org.postgresql:postgresql:9.4.1212",
+			"oracle":"com.oracle:ojdbc14:10.2.0.5.0",
+			"h2":"com.h2database:h2:1.4.194",
+			"mysql":"mysql:mysql-connector-java:5.1.38",
+			"aspectjweaver":"org.aspectj:aspectjweaver:1.8.9",
+			"servlet-api":"javax.servlet:servlet-api:2.5",
+			"lombok":"org.projectlombok:lombok:1.16.16",
+			"hikaricp":"com.zaxxer:HikariCP:2.7.0",
+			"spring-test":"org.springframework:spring-test:${springVersion}",
+			"spring-webmvc":"org.springframework:spring-webmvc:${springVersion}",
+			"spring-context-support":"org.springframework:spring-context-support:${springVersion}",
+			"spring-jdbc":"org.springframework:spring-jdbc:${springVersion}",
+			"spring-tx":"org.springframework:spring-tx:${springVersion}",
+			"druid":"com.alibaba:druid:1.0.29",
+			"fastjson":"com.alibaba:fastjson:1.2.37"
+	]
 }
 
 allprojects{
-    group = 'com.baomidou'
-    version = '2.1.8'
+	group = 'com.baomidou'
+	version = '2.1.8'
 }
 
 
 description = "Mybatis 增强工具包 - 只做增强不做改变,简化CRUD操作"
 
+buildscript {
+	repositories {
+		maven { url "https://repo.spring.io/plugins-release" }
+	}
+	dependencies {
+		classpath("io.spring.gradle:propdeps-plugin:0.0.8")
+	}
+}
 
-subprojects{
+configure(subprojects) {
+	apply plugin: 'propdeps'
+	apply plugin: 'propdeps-maven'
+	apply plugin: 'propdeps-idea'
+	apply plugin: 'propdeps-eclipse'
+}
 
-    apply plugin: 'java'
-    apply plugin: 'maven'
-    apply plugin: 'signing'
-
-    sourceCompatibility = "${javaVersion}"
-    targetCompatibility = "${javaVersion}"
-
-    tasks.withType(JavaCompile) {
-        options.encoding = 'UTF-8'
-    }
-
-    repositories {
-        mavenLocal()
-        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
-        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
-        jcenter()
-    }
-
-    task sourcesJar(type: Jar, dependsOn: classes) {
-        classifier = 'sources'
-        from sourceSets.main.allSource
-    }
-
-    javadoc {
-        options {
-            encoding "UTF-8"
-            charSet 'UTF-8'
-            author true
-            version true
-            failOnError false
-            links "http://docs.oracle.com/javase/7/docs/api"
-        }
-    }
-
-    task javadocJar(type: Jar, dependsOn: javadoc) {
-        classifier = 'javadoc'
-        from 'build/docs/javadoc'
-    }
-
-    artifacts {
-        archives sourcesJar
-        archives javadocJar
-    }
-
-    signing {
-        sign configurations.archives
-    }
-
-    // gradle clean build uploadArchives -Dun=用户名 -Dps=密码 -x test
-    uploadArchives {
-        repositories {
-            mavenDeployer {
-                beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
-
-                def userName = System.getProperty("un")
-                def passWord = System.getProperty("ps")
-                repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
-                    authentication(userName: userName, password: passWord)
-                }
-
-                snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
-                    authentication(userName: userName, password: passWord)
-                }
-
-                pom.version = "$project.version"
-                pom.artifactId = "$project.name"
-                pom.groupId = "$project.group"
-                pom.project {
-                    name 'mybatis-plus'
-                    packaging 'jar'
-                    description 'An enhanced toolkit of Mybatis to simplify development.'
-                    url 'https://github.com/baomidou/mybatis-plus'
-
-                    scm {
-                        connection 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
-                        developerConnection 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
-                        url 'https://github.com/baomidou/mybatis-plus'
-                    }
-
-                    licenses {
-                        license {
-                            name 'The Apache License, Version 2.0'
-                            url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
-                        }
-                    }
-
-                    developers {
-                        developer {
-                            id 'baomidou'
-                            name 'hubin'
-                            email 'jobob@qq.com'
-                        }
-                    }
-                }
-            }
-        }
-    }
+subprojects{
 
+	apply plugin: 'java'
+	apply plugin: 'signing'
+
+	sourceCompatibility = "${javaVersion}"
+	targetCompatibility = "${javaVersion}"
+
+	//noinspection GroovyAssignabilityCheck
+	tasks.withType(JavaCompile) {
+		options.encoding = 'UTF-8'
+	}
+
+	repositories {
+		mavenLocal()
+		maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
+		maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
+		jcenter()
+	}
+
+	task sourcesJar(type: Jar, dependsOn: classes) {
+		classifier = 'sources'
+		from sourceSets.main.allSource
+	}
+
+	javadoc {
+		options {
+			encoding "UTF-8"
+			charSet 'UTF-8'
+			author true
+			version true
+			failOnError false
+			links "http://docs.oracle.com/javase/7/docs/api"
+		}
+	}
+
+	task javadocJar(type: Jar, dependsOn: javadoc) {
+		classifier = 'javadoc'
+		from 'build/docs/javadoc'
+	}
+
+	artifacts {
+		archives sourcesJar
+		archives javadocJar
+	}
+
+	tasks.whenTaskAdded { task ->
+		if (task.name.contains('uploadArchives')||task.name.contains("signArchives")){
+			task.enabled = new File(project.property('signing.secretKeyRingFile') as String).isFile()
+		}
+	}
+
+	signing {
+		sign configurations.archives
+	}
+
+	// gradle clean build uploadArchives -Dun=用户名 -Dps=密码 -x test
+	uploadArchives {
+		repositories {
+			mavenDeployer {
+				beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+				def userName = System.getProperty("un")
+				def passWord = System.getProperty("ps")
+				repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+					//noinspection GroovyAssignabilityCheck
+					authentication(userName: userName, password: passWord)
+				}
+
+				snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
+					//noinspection GroovyAssignabilityCheck
+					authentication(userName: userName, password: passWord)
+				}
+
+				pom.version = "$project.version"
+				pom.artifactId = "$project.name"
+				pom.groupId = "$project.group"
+				pom.project {
+					//noinspection GroovyAssignabilityCheck
+					name 'mybatis-plus'
+					packaging 'jar'
+					description 'An enhanced toolkit of Mybatis to simplify development.'
+					url 'https://github.com/baomidou/mybatis-plus'
+
+					scm {
+						connection 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
+						developerConnection 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
+						url 'https://github.com/baomidou/mybatis-plus'
+					}
+
+					licenses {
+						license {
+							//noinspection GroovyAssignabilityCheck
+							name 'The Apache License, Version 2.0'
+							url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+						}
+					}
+
+					developers {
+						developer {
+							id 'baomidou'
+							//noinspection GroovyAssignabilityCheck
+							name 'hubin'
+							email 'jobob@qq.com'
+						}
+					}
+				}
+			}
+		}
+	}
+
+	compileJava.dependsOn(processResources)
 }

+ 27 - 31
mybatis-plus-core/build.gradle

@@ -1,33 +1,29 @@
-def common = [
-    rootProject.ext.dependencies["spring-context-support"],
-    rootProject.ext.dependencies["spring-jdbc"]
-]
 dependencies {
-    compile project(":mybatis-plus-support")
-    compile rootProject.ext.dependencies["jsqlparser"]
-    compile rootProject.ext.dependencies["mybatis-spring"]
-    compile rootProject.ext.dependencies["mybatis"]
-    compileOnly common
-    testCompile common
-    testCompile rootProject.ext.dependencies["servlet-api"]
-    testCompile rootProject.ext.dependencies["mybatis-ehcache"]
-    testCompile rootProject.ext.dependencies["logback-classic"]
-    testCompile rootProject.ext.dependencies["junit"]
-    testCompile (rootProject.ext.dependencies["commons-dbcp2"]){
-        exclude module: "commons-logging"
-    }
-    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["slf4j-api"]
-    testCompile rootProject.ext.dependencies["spring-test"]
-    testCompile rootProject.ext.dependencies["spring-webmvc"]
-    testCompile rootProject.ext.dependencies["sqlserver"]
-    testCompile rootProject.ext.dependencies["aspectjweaver"]
-    testCompile rootProject.ext.dependencies["lombok"]
-    testCompile rootProject.ext.dependencies["hikaricp"]
-    testCompile rootProject.ext.dependencies["druid"]
-    testCompile rootProject.ext.dependencies["fastjson"]
+	compile project(":mybatis-plus-support")
+	compile rootProject.ext.dependencies["jsqlparser"]
+	compile rootProject.ext.dependencies["mybatis-spring"]
+	compile rootProject.ext.dependencies["mybatis"]
+	optional rootProject.ext.dependencies["spring-context-support"]
+	optional rootProject.ext.dependencies["spring-jdbc"]
+	testCompile rootProject.ext.dependencies["servlet-api"]
+	testCompile rootProject.ext.dependencies["mybatis-ehcache"]
+	testCompile rootProject.ext.dependencies["logback-classic"]
+	testCompile rootProject.ext.dependencies["junit"]
+	testCompile (rootProject.ext.dependencies["commons-dbcp2"]){
+		exclude module: "commons-logging"
+	}
+	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["slf4j-api"]
+	testCompile rootProject.ext.dependencies["spring-test"]
+	testCompile rootProject.ext.dependencies["spring-webmvc"]
+	testCompile rootProject.ext.dependencies["sqlserver"]
+	testCompile rootProject.ext.dependencies["aspectjweaver"]
+	testCompile rootProject.ext.dependencies["lombok"]
+	testCompile rootProject.ext.dependencies["hikaricp"]
+	testCompile rootProject.ext.dependencies["druid"]
+	testCompile rootProject.ext.dependencies["fastjson"]
 }

+ 8 - 9
mybatis-plus-generate/build.gradle

@@ -1,12 +1,11 @@
 dependencies {
-    compile project(":mybatis-plus-support")
-    compileOnly rootProject.ext.dependencies["velocity"]
-    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 rootProject.ext.dependencies["velocity"]
+	compile project(":mybatis-plus-support")
+	provided rootProject.ext.dependencies["velocity"]
+	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 rootProject.ext.dependencies["junit"]
 }

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

@@ -1,6 +1,6 @@
 dependencies {
-    compileOnly rootProject.ext.dependencies["mybatis-spring"]
-    compileOnly rootProject.ext.dependencies["mybatis"]
-    compileOnly rootProject.ext.dependencies["spring-context-support"]
-    compileOnly rootProject.ext.dependencies["spring-jdbc"]
+	optional rootProject.ext.dependencies["mybatis-spring"]
+	optional rootProject.ext.dependencies["mybatis"]
+	optional rootProject.ext.dependencies["spring-context-support"]
+	optional rootProject.ext.dependencies["spring-jdbc"]
 }