diff --git a/.gitignore b/.gitignore index 4916f7a2..d4d9b5e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ ###################################################################### # Build Tools +mvn-build .gradle -/build/ +**/.gradle +**/build/ !gradle/wrapper/gradle-wrapper.jar target/ @@ -40,4 +42,4 @@ nbdist/ !*/build/*.java !*/build/*.html -!*/build/*.xml \ No newline at end of file +!*/build/*.xml diff --git a/bin/package.sh b/bin/package.sh new file mode 100755 index 00000000..426da60c --- /dev/null +++ b/bin/package.sh @@ -0,0 +1,2 @@ +#!/bin/bash +mvn clean package -Dmaven.test.skip=true diff --git a/build-config/build-all.gradle b/build-config/build-all.gradle new file mode 100644 index 00000000..77b70ffa --- /dev/null +++ b/build-config/build-all.gradle @@ -0,0 +1,14 @@ +//该产品的构建基本配置,公司统一模板,禁止开发人员修改。 +allprojects { + def releaseVersion = System.getProperty("releaseVersion") + version = releaseVersion ? releaseVersion : "${devVersion}" +} +ext { + buildProduct = System.getProperty("buildProduct") ?: false +} +task abuildAllModule(type: Exec) { + workingDir("../") + executable "build-config/build_jar.sh" + args(project.name) +} + diff --git a/build-config/build-base.gradle b/build-config/build-base.gradle new file mode 100644 index 00000000..9a455811 --- /dev/null +++ b/build-config/build-base.gradle @@ -0,0 +1,80 @@ +//该产品的构建基本配置,公司统一模板,禁止开发人员修改。 +ext { + swaggerVersion = "3.0.0" + lombokVersion = "1.18.16" + junitVersion = "4.13.1" + logbackVersion = "1.2.3" +} + +task copyConfig(type: Copy) { + from "src/main/resources/application.properties" + from "src/main/resources/application.yaml" + from "src/main/resources/appServer.conf" + from "src/main/resources/subGui.conf" + into "build/libs/" +} +task copySql(type: Copy) { + from "src/main/resources/sql" + into "build/libs/sql" +} +task cleanGridnt(type: Exec) { + executable "../rmGridntJar.sh" +} +clean { + delete = ["build", "out", "dist_java", "boot", "log", "logs",] +} +[compileJava, compileTestJava]*.options*.encoding = "UTF-8" +[compileJava, compileTestJava]*.sourceCompatibility = "11" +[compileJava, compileTestJava]*.targetCompatibility = "11" + +repositories { + mavenLocal() + mavenCentral() + maven { url "https://maven.aliyun.com/repository/public/" } +// maven { url "http://192.168.8.200:8081/repository/public/" } +} +configurations.all { + resolutionStrategy.cacheChangingModulesFor 0, "seconds" + resolutionStrategy.cacheDynamicVersionsFor 0, "seconds" +} + +dependencies { + /*lombok依赖*/ + testCompile "junit:junit:${junitVersion}" + + compileOnly "org.projectlombok:lombok:${lombokVersion}" + annotationProcessor "org.projectlombok:lombok:${lombokVersion}" + testCompileOnly "org.projectlombok:lombok:${lombokVersion}" + testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}" + + compile "ch.qos.logback:logback-classic:${logbackVersion}" + testCompileOnly "ch.qos.logback:logback-classic:${logbackVersion}" + +} + +jar { +// // 排除掉模块调试的资源文件, 启动类. +// excludes = ["file/WaveAnalysis", "com/gridnt/**/*Starter*", "logback*.xml", +// "application*.properties", "application*.yaml", "config" +// ] + manifest { + attributes "releaseVersion": version + "-" + getGitVersion() + attributes "vendor": "GRIDNT山东网聪信息科技有限公司 build" + attributes "description": "重新编译打包,引用的其它组织的代码,著作圈原作者所有" + attributes "buildTime": new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT+08:00")) + } +} +apply plugin: "org.sonarqube" +sonarqube { + properties { + property "sonar.projectKey", "${project.name}" + property "sonar.projectName", "${project.name}" + property "sonar.sources", "src" + property "sonar.java.binaries", "build" + property "sonar.exclusions", "**/**test**/**" + property "sonar.sourceEncoding", "UTF-8" + } +} + + + diff --git a/build-config/build-boot-jar.gradle b/build-config/build-boot-jar.gradle new file mode 100644 index 00000000..df00ceff --- /dev/null +++ b/build-config/build-boot-jar.gradle @@ -0,0 +1,28 @@ +//该产品的构建基本配置,公司统一模板,禁止开发人员开发过程中修改。 +apply plugin: "org.springframework.boot" + +// 清除现有的lib目录 +task clearJar(type: Delete) { + delete "$buildDir\\libs\\lib" +} + +// 将依赖包复制到lib目录 +task copyJar(type: Copy, dependsOn: "clearJar") { + from configurations.compileClasspath + into "$buildDir\\libs\\lib" +} + +bootJar { +// excludes = ["file/WaveAnalysis", "*.jar", "*.properties", "*.yaml", "config", "*.conf"] + manifest { + attributes "Main-Class": "org.springframework.boot.loader.PropertiesLauncher" + attributes "Manifest-Release-Version": version + "-" + getGitVersion() +// attributes "Class-Path": configurations.runtime.files.collect { "../lib/$it.name" }.join(" ") + attributes "releaseVersion": version + "-" + getGitVersion() + attributes "vendor": "GRIDNT山东网聪信息科技有限公司" + attributes "buildTime": new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT+08:00")) + } +// launchScript() +} dependsOn(clearJar, copyJar, copyConfig, copySql) + + diff --git a/build-config/build-publish.gradle b/build-config/build-publish.gradle new file mode 100644 index 00000000..e28cf242 --- /dev/null +++ b/build-config/build-publish.gradle @@ -0,0 +1,44 @@ +apply plugin: "maven-publish" + +task sourcesJar(type: Jar) { + from sourceSets.main.allJava + archiveClassifier = "sources" +} +publishing { + + publications { + maven(MavenPublication) { + artifactId "${archivesBaseName}" + version project.version + //如果是war包填写components.web,如果是jar包填写components.java + from components.java + artifact sourcesJar + } + mavenJava(MavenPublication) { + versionMapping { + usage("java-api") { + fromResolutionOf("runtimeClasspath") + } + usage("java-runtime") { + fromResolutionResult() + } + } + } + } + + repositories { + maven { + //指定要上传的maven私服仓库 + def releasesRepoUrl = "http://192.168.8.200:8081/repository/releases" + def snapshotsRepoUrl = "http://192.168.8.200:8081/repository/snapshots/" + url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl + println "${group} ${archivesBaseName} publishing version is ${version}" + //认证用户和密码 + credentials { + username "developer" + password "dev123" + } + } + } +} + diff --git a/build-config/build_jar.sh b/build-config/build_jar.sh new file mode 100755 index 00000000..d109acf0 --- /dev/null +++ b/build-config/build_jar.sh @@ -0,0 +1,31 @@ +#!/bin/bash +#echo " 本脚本参数说明,支持一个参数,当前模块目录" +bootModule=$1 +echo "bootModule is :" $bootModule +# 准备 bootjar 依赖目录 +rm -rf $bootModule/$bootModule-gui/libs $bootModule/$bootModule-server/libs +mkdir -p $bootModule/$bootModule-gui/libs $bootModule/$bootModule-server/libs + +# 编译各个模块 +for dir in $(ls .) +do + if [[ -d $dir && -f $dir/build.gradle && $dir != 'build-config' && $dir != $bootModule ]] ; then + + # 清理 + if [[ -d $dir/$dir-pub ]] ; then rm -rf $dir/$dir-pub/build ;fi + if [[ -d $dir/$dir-gui ]] ; then rm -rf $dir/$dir-gui/build ;fi + if [[ -d $dir/$dir-server ]] ; then rm -rf $dir/$dir-server/build ;fi + rm -rf $dir/.gradle $dir/.idea + echo "gradle home is =" $PATH + $GRADLE_HOME/bin/gradle $gradleArgs --daemon --parallel -x test -DbuildProduct=true -b $dir/build.gradle jar --s + + # 拷贝gui server公用jar到对应的目录。 + if [[ -d $dir/$dir-pub ]] ; then echo $bootModule/$bootModule-gui/libs/ $bootModule/$bootModule-server/libs | xargs -n 1 cp -f $dir/$dir-pub/build/libs/*.jar ;fi + if [[ -d $dir/$dir-gui ]] ; then cp -f $dir/$dir-gui/build/libs/*.jar $bootModule/$bootModule-gui/libs;fi + if [[ -d $dir/$dir-server ]] ; then cp -f $dir/$dir-server/build/libs/*.jar $bootModule/$bootModule-server/libs;fi + + if [ 0 -ne $? ] ; then echo "$dir build failed, please check the error log! "; exit 1 ; fi + echo -e "\033[32m----------------- $dir 模块编译成功 ---------------------- \033[0m" + fi +done +echo "BUILD SUCCESSFUL " `date` diff --git a/build-config/logback-spring.xml b/build-config/logback-spring.xml new file mode 100644 index 00000000..1280b1c2 --- /dev/null +++ b/build-config/logback-spring.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/build-config/product-pub.gradle b/build-config/product-pub.gradle new file mode 100644 index 00000000..656108bf --- /dev/null +++ b/build-config/product-pub.gradle @@ -0,0 +1,24 @@ +import org.codehaus.groovy.runtime.GStringImpl + +//共享的非业务功能模块,禁止将其它业务功能模块添加进来 +// 该产品 gui 和 appServer都需要的依赖 +ext { + gridntBase = "${devVersion}" as GStringImpl +// gridntBase = "2.1.0" + svgshowVersion = "2.1.0" + protectVersion = "2.1.1" + mybatisPlus = "3.2.0" + debugProduct = System.getProperty("debugProduct") ?: false +} +dependencies { + //-------网聪 开发中的模块---------------------------------------------------------------------------------------- + implementation "com.gridnt:gridnt-base-pub:${gridntBase}" + + //-------网聪正式发布的共享模块------------------------------------------------------------------------------------- + + + //-------第三依赖 ----------------------------------------------------------------------- + implementation "org.springframework.boot:spring-boot-starter-logging:${springBoot}" + +} + diff --git a/build-config/product-third-gui.gradle b/build-config/product-third-gui.gradle new file mode 100644 index 00000000..097d443a --- /dev/null +++ b/build-config/product-third-gui.gradle @@ -0,0 +1,41 @@ +apply plugin: "org.openjfx.javafxplugin" +//apply plugin: "com.github.ayltai.spring-graalvm-native-plugin" +javafx { + version = "11.0.2" +// version = "15.0.1" + modules = ["javafx.base", "javafx.controls", "javafx.fxml", "javafx.graphics", "javafx.media" + , "javafx.swing", "javafx.web" + ] +} + + +//共享的功能模块 +dependencies { + //------- 一、网聪 开发中的模块---------------------------------------------------------------------------------------- + + implementation "com.gridnt:gridnt-base-gui:${gridntBase}" + + //------- 1.1 网聪产品间共享的业务功能模块------------------------------------------------------------------------------ + if (debugProduct) { + // 构建产品,产品全功能运行 + compile fileTree(dir: "libs", include: ["*.jar"]) + + } + + + //------- 二、网聪正式发布工具类 共享模块-------------------------------------------------------------------------------- + + implementation "com.gridnt:springboot-javafx-support:${devVersion}" + + + //-------独有的第三依赖------------------------------------------------------------------------------------------- + implementation "org.yaml:snakeyaml:1.27" + + //---------- 测试 --------------------------------------------------------------------------------------------- + + testCompile "org.springframework.boot:spring-boot-starter-test:${springBoot}" + + //-------runtime----------------------------------------------------------------------------------------------- + testCompile "org.springframework.boot:spring-boot-devtools:${springBoot}" + +} \ No newline at end of file diff --git a/build-config/product-third-server.gradle b/build-config/product-third-server.gradle new file mode 100644 index 00000000..d0346ab7 --- /dev/null +++ b/build-config/product-third-server.gradle @@ -0,0 +1,33 @@ +ext { + mybatisPlus = "3.4.1" +} + +dependencies { + + //------- 一、网聪 开发中的模块---------------------------------------------------------------------------------------- + + implementation "com.gridnt:gridnt-base-server:${gridntBase}" + + //------- 1.1 网聪产品间共享的业务功能模块--------------------------------------------------------------- + if (debugProduct) { + // 构建产品,产品全功能运行 + compile fileTree(dir: "libs", include: ["*.jar"]) + + + } + + //------- 二、网聪正式发布工具类 共享模块-------------------------------------------------------------------------------- + + + //-------产品独有的第三依赖------------------------------------------------------------------------------------------- + + implementation "org.springframework.boot:spring-boot-starter-data-redis:${springBoot}" + implementation "com.fasterxml.jackson.core:jackson-databind:2.12.0" + + //-------runtime----------------------------------------------------------------------------------------------- + + //---------- 测试 --------------------------------------------------------------------------------------------- + testCompile "org.springframework.boot:spring-boot-starter-test:${springBoot}" + + +} \ No newline at end of file diff --git a/build-config/publish.sh b/build-config/publish.sh new file mode 100755 index 00000000..1e66a680 --- /dev/null +++ b/build-config/publish.sh @@ -0,0 +1,7 @@ +#! /bin/bash +# 发布之前,必须先提交 !!!! 发布之前,必须先提交 !!!! 发布之前,必须先提交 !!!! +# 使用方法: ./publish.sh 版本号. +# git pull; git add . ;git commit -m " 发布版本 $*" ; git push + +gradle --daemon --parallel -DbuildProduct=true clean publish -DreleaseVersion=$1 + diff --git a/build-product.gradle b/build-product.gradle new file mode 100644 index 00000000..b06d02ff --- /dev/null +++ b/build-product.gradle @@ -0,0 +1,41 @@ +ext { + springBoot = "2.4.0" + alibabaCloud = "2.2.3.RELEASE" + springCloud = "2.2.6.RELEASE" +} +dependencies { + runtime group: 'org.springframework.cloud', name: 'spring-cloud-dependencies', version: 'Hoxton.SR9', ext: 'pom' + + + implementation "com.alibaba.cloud:spring-cloud-alibaba-sentinel-gateway:${alibabaCloud}" + implementation "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:${alibabaCloud}" + implementation "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:${alibabaCloud}" + implementation "com.alibaba.cloud:spring-cloud-starter-alibaba-sentinel:${alibabaCloud}" + implementation "com.alibaba.csp:sentinel-datasource-nacos:1.8.0" + implementation "com.alibaba:fastjson:1.2.75" + implementation "com.fasterxml.jackson.core:jackson-databind:2.12.0" + implementation "com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" + implementation "com.github.penggle:kaptcha:2.3.2" + implementation "com.github.tobato:fastdfs-client:1.27.2" + implementation "commons-fileupload:commons-fileupload:1.4" + implementation "commons-io:commons-io:2.8.0" + implementation "de.codecentric:spring-boot-admin-starter-server:2.3.0" + implementation "io.springfox:springfox-swagger2:2.9.2" + implementation "io.springfox:springfox-swagger-ui:2.9.2" + implementation "io.swagger:swagger-annotations:1.5.24" + implementation "javax.servlet:javax.servlet-api:4.0.1" + implementation "mysql:mysql-connector-java:8.0.21" + implementation "org.apache.commons:commons-lang3:3.11" + implementation "org.apache.commons:commons-pool2:2.9.0" + implementation "org.apache.poi:poi-ooxml:4.1.2" + implementation "org.quartz-scheduler:quartz:2.3.2" + implementation "org.springframework.boot:spring-boot-starter-actuator:${springBoot}" + implementation "org.springframework.boot:spring-boot-starter-data-redis:${springBoot}" + implementation "org.springframework.boot:spring-boot-starter-security:${springBoot}" + implementation "org.springframework.boot:spring-boot-starter-validation:${springBoot}" + implementation "org.springframework.boot:spring-boot-starter-web:${springBoot}" + implementation "org.springframework.cloud:spring-cloud-starter-gateway:${springCloud}" + implementation "org.springframework.cloud:spring-cloud-starter-openfeign:${springCloud}" + implementation "org.springframework.boot:spring-boot-starter-web:${springBoot}" + +} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..1e2d0898 --- /dev/null +++ b/build.gradle @@ -0,0 +1,32 @@ +buildscript { + repositories { + mavenLocal() + mavenCentral() + maven { url "https://maven.aliyun.com/repository/public/" } +// maven { url "http://192.168.8.200:8081/repository/public/" } + maven { url "https://plugins.gradle.org/m2/" } + } + ext { + springBoot = "2.4.0" + } + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBoot}") + classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8" + } +} +ext { + devVersion = "dev-9-SNAPSHOT" +} + + +apply from: "build-config/build-all.gradle" +subprojects { + apply plugin: "java" + apply plugin: "idea" + apply plugin: "io.spring.dependency-management" + archivesBaseName = "project-${project.name}" +} + +static def getGitVersion() { + return System.getProperty("gitVersion") ?: "git rev-parse --short HEAD".execute().text.trim() +} diff --git a/buildSrc.7z b/buildSrc.7z new file mode 100644 index 00000000..54699f3c Binary files /dev/null and b/buildSrc.7z differ diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..e708b1c0 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..be52383e --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..4f906e0c --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..107acd32 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/ruoyi-api/ruoyi-api-system/build.gradle b/ruoyi-api/ruoyi-api-system/build.gradle new file mode 100644 index 00000000..885a43a3 --- /dev/null +++ b/ruoyi-api/ruoyi-api-system/build.gradle @@ -0,0 +1,8 @@ +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-publish.gradle" +apply from: "../../build-product.gradle" +dependencies { + implementation project(':ruoyi-common-core') +} + +description = 'ruoyi-api-system' diff --git a/ruoyi-auth/build.gradle b/ruoyi-auth/build.gradle new file mode 100644 index 00000000..04c7e158 --- /dev/null +++ b/ruoyi-auth/build.gradle @@ -0,0 +1,12 @@ +apply from: "../build-config/build-base.gradle" +apply from: "../build-config/build-boot-jar.gradle" +apply from: "../build-product.gradle" + +dependencies { + + implementation project(':ruoyi-common-security') + implementation project(':ruoyi-common-core') + implementation project(':ruoyi-api-system') +} + +description = 'ruoyi-auth' diff --git a/ruoyi-common/publish.sh b/ruoyi-common/publish.sh new file mode 100755 index 00000000..926f5b00 --- /dev/null +++ b/ruoyi-common/publish.sh @@ -0,0 +1,12 @@ +#! /bin/bash +# 发布之前,必须先提交 !!!! 发布之前,必须先提交 !!!! 发布之前,必须先提交 !!!! +# 使用方法: ./publish.sh 版本号. +# git pull; git add . ;git commit -m " 发布版本 $*" ; git push + +for p in $(ls .) +do + gradle --daemon --parallel -DbuildProduct=true -b $p/build.grade clean publish -DreleaseVersion=$1 +done + + + diff --git a/ruoyi-common/ruoyi-common-core/build.gradle b/ruoyi-common/ruoyi-common-core/build.gradle new file mode 100644 index 00000000..197da392 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/build.gradle @@ -0,0 +1,13 @@ +group = "com.ruoyi" + +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-publish.gradle" + +apply from: "../../build-product.gradle" + +dependencies { + + +} + +description = 'ruoyi-common-core' diff --git a/ruoyi-common/ruoyi-common-datascope/build.gradle b/ruoyi-common/ruoyi-common-datascope/build.gradle new file mode 100644 index 00000000..88edcba9 --- /dev/null +++ b/ruoyi-common/ruoyi-common-datascope/build.gradle @@ -0,0 +1,14 @@ +group = "com.ruoyi" + +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-publish.gradle" +apply from: "../../build-product.gradle" +dependencies { + + implementation project(':ruoyi-common-core') + implementation project(':ruoyi-common-security') + implementation project(':ruoyi-api-system') + +} + +description = 'ruoyi-common-datascope' diff --git a/ruoyi-common/ruoyi-common-log/build.gradle b/ruoyi-common/ruoyi-common-log/build.gradle new file mode 100644 index 00000000..068d6880 --- /dev/null +++ b/ruoyi-common/ruoyi-common-log/build.gradle @@ -0,0 +1,12 @@ +group = "com.ruoyi" +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-publish.gradle" + +apply from: "../../build-product.gradle" +dependencies { + implementation project(':ruoyi-api-system') + implementation project(':ruoyi-common-security') + implementation project(':ruoyi-common-core') +} + +description = 'ruoyi-common-log' diff --git a/ruoyi-common/ruoyi-common-redis/build.gradle b/ruoyi-common/ruoyi-common-redis/build.gradle new file mode 100644 index 00000000..ff9ed56e --- /dev/null +++ b/ruoyi-common/ruoyi-common-redis/build.gradle @@ -0,0 +1,12 @@ +group = "com.ruoyi" +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-publish.gradle" + +apply from: "../../build-product.gradle" + +dependencies { + + implementation project(':ruoyi-common-core') +} + +description = 'ruoyi-common-redis' diff --git a/ruoyi-common/ruoyi-common-security/build.gradle b/ruoyi-common/ruoyi-common-security/build.gradle new file mode 100644 index 00000000..0d8ab91f --- /dev/null +++ b/ruoyi-common/ruoyi-common-security/build.gradle @@ -0,0 +1,12 @@ +group = "com.ruoyi" +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-publish.gradle" + +apply from: "../../build-product.gradle" +dependencies { + implementation project(':ruoyi-common-core') + implementation project(':ruoyi-api-system') + implementation project(':ruoyi-common-redis') +} + +description = 'ruoyi-common-security' diff --git a/ruoyi-common/ruoyi-common-swagger/build.gradle b/ruoyi-common/ruoyi-common-swagger/build.gradle new file mode 100644 index 00000000..85646729 --- /dev/null +++ b/ruoyi-common/ruoyi-common-swagger/build.gradle @@ -0,0 +1,10 @@ +group = "com.ruoyi" +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-publish.gradle" + +apply from: "../../build-product.gradle" +dependencies { + +} + +description = 'ruoyi-common-swagger' diff --git a/ruoyi-gateway/build.gradle b/ruoyi-gateway/build.gradle new file mode 100644 index 00000000..8e5070a3 --- /dev/null +++ b/ruoyi-gateway/build.gradle @@ -0,0 +1,10 @@ +apply from: "../build-config/build-base.gradle" +apply from: "../build-config/build-boot-jar.gradle" +apply from: "../build-product.gradle" +dependencies { + implementation project(':ruoyi-common-redis') + implementation project(':ruoyi-common-security') + implementation project(':ruoyi-common-core') +} + +description = 'ruoyi-gateway' diff --git a/ruoyi-modules/ruoyi-file/build.gradle b/ruoyi-modules/ruoyi-file/build.gradle new file mode 100644 index 00000000..93f09230 --- /dev/null +++ b/ruoyi-modules/ruoyi-file/build.gradle @@ -0,0 +1,13 @@ +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-boot-jar.gradle" + +apply from: "../../build-product.gradle" +dependencies { + implementation project(':ruoyi-api-system') + implementation project(':ruoyi-common-core') + implementation project(':ruoyi-common-swagger') + + +} + +description = 'ruoyi-modules-file' diff --git a/ruoyi-modules/ruoyi-gen/build.gradle b/ruoyi-modules/ruoyi-gen/build.gradle new file mode 100644 index 00000000..1666eacb --- /dev/null +++ b/ruoyi-modules/ruoyi-gen/build.gradle @@ -0,0 +1,23 @@ +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-boot-jar.gradle" +apply from: "../../build-product.gradle" + +dependencies { + implementation project(':ruoyi-common-log') + implementation project(':ruoyi-common-security') + implementation project(':ruoyi-common-core') + implementation project(':ruoyi-common-swagger') + + implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.3.RELEASE' + implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.2.3.RELEASE' + implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-sentinel:2.2.3.RELEASE' + + implementation 'org.springframework.boot:spring-boot-starter-actuator:2.3.4.RELEASE' + implementation 'org.springframework.boot:spring-boot-starter-validation:2.3.4.RELEASE' + + implementation 'io.springfox:springfox-swagger-ui:2.9.2' + implementation 'org.apache.velocity:velocity:1.7' + implementation 'mysql:mysql-connector-java:8.0.21' +} + +description = 'ruoyi-modules-gen' diff --git a/ruoyi-modules/ruoyi-job/build.gradle b/ruoyi-modules/ruoyi-job/build.gradle new file mode 100644 index 00000000..d81c7c3a --- /dev/null +++ b/ruoyi-modules/ruoyi-job/build.gradle @@ -0,0 +1,13 @@ +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-boot-jar.gradle" + +apply from: "../../build-product.gradle" + +dependencies { + implementation project(':ruoyi-common-log') + implementation project(':ruoyi-common-swagger') + implementation project(':ruoyi-common-core') + implementation project(':ruoyi-common-security') +} + +description = 'ruoyi-modules-job' diff --git a/ruoyi-modules/ruoyi-system/build.gradle b/ruoyi-modules/ruoyi-system/build.gradle new file mode 100644 index 00000000..83c8c277 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/build.gradle @@ -0,0 +1,18 @@ +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-boot-jar.gradle" + +apply from: "../../build-product.gradle" + +dependencies { + + implementation project(':ruoyi-common-datascope') + implementation project(':ruoyi-common-log') + implementation project(':ruoyi-common-core') + implementation project(':ruoyi-common-swagger') + implementation project(':ruoyi-common-security') + implementation project(':ruoyi-api-system') + implementation project(':ruoyi-common-redis') + +} + +description = 'ruoyi-modules-system' diff --git a/ruoyi-visual/ruoyi-monitor/build.gradle b/ruoyi-visual/ruoyi-monitor/build.gradle new file mode 100644 index 00000000..2efffc91 --- /dev/null +++ b/ruoyi-visual/ruoyi-monitor/build.gradle @@ -0,0 +1,11 @@ +apply from: "../../build-config/build-base.gradle" +apply from: "../../build-config/build-boot-jar.gradle" + +apply from: "../../build-product.gradle" + +dependencies { + implementation project(':ruoyi-common-core') + +} + +description = 'ruoyi-visual-monitor' diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..4aa1e509 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,37 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +rootProject.name = 'ruoyi' + +include(':ruoyi-modules-job') +include(':ruoyi-common') +include(':ruoyi-common-swagger') +include(':ruoyi-api-system') +include(':ruoyi-common-log') +include(':ruoyi-common-datascope') +include(':ruoyi-api') +include(':ruoyi-modules') +include(':ruoyi-common-redis') +include(':ruoyi-visual-monitor') +include(':ruoyi-visual') +include(':ruoyi-modules-file') +include(':ruoyi-modules-gen') +include(':ruoyi-common-core') +include(':ruoyi-auth') +include(':ruoyi-common-security') +include(':ruoyi-gateway') +include(':ruoyi-modules-system') +project(":ruoyi-modules-job").projectDir = file('.') +project(":ruoyi-modules-job").projectDir = file('ruoyi-modules/ruoyi-job') +project(":ruoyi-common-swagger").projectDir = file('ruoyi-common/ruoyi-common-swagger') +project(":ruoyi-api-system").projectDir = file('ruoyi-api/ruoyi-api-system') +project(":ruoyi-common-log").projectDir = file('ruoyi-common/ruoyi-common-log') +project(":ruoyi-common-datascope").projectDir = file('ruoyi-common/ruoyi-common-datascope') +project(":ruoyi-common-redis").projectDir = file('ruoyi-common/ruoyi-common-redis') +project(":ruoyi-visual-monitor").projectDir = file('ruoyi-visual/ruoyi-monitor') +project(":ruoyi-modules-file").projectDir = file('ruoyi-modules/ruoyi-file') +project(":ruoyi-modules-gen").projectDir = file('ruoyi-modules/ruoyi-gen') +project(":ruoyi-common-core").projectDir = file('ruoyi-common/ruoyi-common-core') +project(":ruoyi-common-security").projectDir = file('ruoyi-common/ruoyi-common-security') +project(":ruoyi-modules-system").projectDir = file('ruoyi-modules/ruoyi-system')