build.gradle 3.6 KB
Newer Older
梦境迷离's avatar
梦境迷离 已提交
1 2 3 4 5 6
buildscript {
    ext {
        springBootVersion = '1.5.9.RELEASE'
    }
    repositories {
        mavenCentral()
梦境迷离's avatar
重构  
梦境迷离 已提交
7 8 9
        maven {
            url "https://plugins.gradle.org/m2/"
        }
梦境迷离's avatar
梦境迷离 已提交
10 11 12 13 14
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        //spring boot hot deploy plugin
        classpath("org.springframework:springloaded:1.2.5.RELEASE")
梦境迷离's avatar
重构  
梦境迷离 已提交
15
        classpath "com.diffplug.spotless:spotless-plugin-gradle:6.0.0"
梦境迷离's avatar
梦境迷离 已提交
16 17
    }
}
梦境迷离's avatar
梦境迷离 已提交
18 19 20 21 22 23

apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'org.springframework.boot'
梦境迷离's avatar
重构  
梦境迷离 已提交
24
apply plugin: "com.diffplug.spotless"
梦境迷离's avatar
梦境迷离 已提交
25 26 27 28 29 30 31

eclipse {
    classpath {
        downloadSources = true
        downloadJavadoc = false
    }
}
梦境迷离's avatar
梦境迷离 已提交
32 33 34 35 36 37

ext {
    sourceCompatibility = 1.8
    targetCompatibility = 1.8
}
jar {
梦境迷离's avatar
梦境迷离 已提交
38 39 40
    manifest {
        attributes 'Main-Class': 'io.github.dreamylost.Application'
    }
梦境迷离's avatar
梦境迷离 已提交
41
    archiveBaseName.set('Sim')
42
    archiveVersion.set('1.3.1')
梦境迷离's avatar
重构  
梦境迷离 已提交
43
    destinationDirectory.set(file("$rootDir/dist"))
梦境迷离's avatar
梦境迷离 已提交
44 45 46
}

repositories {
47
//    maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
梦境迷离's avatar
梦境迷离 已提交
48
    jcenter()
梦境迷离's avatar
梦境迷离 已提交
49
    mavenCentral()
梦境迷离's avatar
梦境迷离 已提交
50 51
}

梦境迷离's avatar
梦境迷离 已提交
52

梦境迷离's avatar
梦境迷离 已提交
53 54 55 56 57 58 59 60 61 62 63
dependencies {
    //spring boot
    compile("org.springframework.boot:spring-boot-starter-web") {
        transitive = false
    }
    compile("org.springframework.boot:spring-boot-starter-actuator")
    compile("org.springframework.boot:spring-boot-starter-websocket")
    compile("org.springframework.boot:spring-boot-starter-data-redis")
    compile("org.springframework.boot:spring-boot-starter-mail")

    //scala
梦境迷离's avatar
重构  
梦境迷离 已提交
64
    compile "org.scala-lang:scala-library:2.13.6"
梦境迷离's avatar
梦境迷离 已提交
65 66

    //mysql driver
梦境迷离's avatar
重构  
梦境迷离 已提交
67
    compile("mysql:mysql-connector-java:8.0.27")
梦境迷离's avatar
梦境迷离 已提交
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

    //alibaba druid
    compile 'com.alibaba:druid:1.0.26'

    //mybatis
    compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:1.1.1")
    compile("com.github.pagehelper:pagehelper:4.1.0")

    //spring security
    compile("org.springframework.security:spring-security-core:4.1.3.RELEASE")

    //swagger
    compile("io.springfox:springfox-swagger2:2.2.2")
    compile("io.springfox:springfox-swagger-ui:2.2.2")

    //Tomcat
    compile("org.apache.tomcat.embed:tomcat-embed-jasper:+")
    compile("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
    compile("org.apache.taglibs:taglibs-standard-impl:1.2.5")

梦境迷离's avatar
梦境迷离 已提交
88
    //akka http
梦境迷离's avatar
梦境迷离 已提交
89 90 91 92
    compile 'com.typesafe.akka:akka-actor_2.13:2.5.32'
    compile 'com.typesafe.akka:akka-http_2.13:10.1.10'
    compile 'com.typesafe.akka:akka-slf4j_2.13:2.5.32'
    compile 'com.typesafe.akka:akka-stream_2.13:2.5.32'
梦境迷离's avatar
梦境迷离 已提交
93

梦境迷离's avatar
梦境迷离 已提交
94
    //publish
梦境迷离's avatar
梦境迷离 已提交
95
    compile 'org.reactivestreams:reactive-streams:1.0.0'
梦境迷离's avatar
梦境迷离 已提交
96 97

    //config
梦境迷离's avatar
梦境迷离 已提交
98
    compile 'com.typesafe:config:1.2.1'
梦境迷离's avatar
梦境迷离 已提交
99

梦境迷离's avatar
重构  
梦境迷离 已提交
100
    // scala 序列化
梦境迷离's avatar
梦境迷离 已提交
101 102 103 104 105
    compile 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
    compile 'com.fasterxml.jackson.core:jackson-core:2.13.0'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.13.0'
    compile 'com.fasterxml.jackson.module:jackson-module-scala_2.13:2.13.0'
    compile 'com.fasterxml.jackson.module:jackson-modules-java8:2.13.0'
梦境迷离's avatar
重构  
梦境迷离 已提交
106

梦境迷离's avatar
梦境迷离 已提交
107
    //  自己写的的工具
梦境迷离's avatar
梦境迷离 已提交
108
    compile 'org.bitlap:scala-macro-tools_2.13:0.3.4'
梦境迷离's avatar
梦境迷离 已提交
109

梦境迷离's avatar
梦境迷离 已提交
110 111 112
    //test
    testCompile("org.springframework.boot:spring-boot-starter-test")
    testCompile("junit:junit:4.12")
梦境迷离's avatar
梦境迷离 已提交
113
    
梦境迷离's avatar
梦境迷离 已提交
114 115
}

梦境迷离's avatar
梦境迷离 已提交
116 117
spotless {
    scala {
梦境迷离's avatar
重构  
梦境迷离 已提交
118
        scalafmt('2.7.5').configFile('.scalafmt.conf')
梦境迷离's avatar
梦境迷离 已提交
119 120
    }
}
梦境迷离's avatar
梦境迷离 已提交
121

梦境迷离's avatar
梦境迷离 已提交
122
bootRepackage.enabled = true
梦境迷离's avatar
重构  
梦境迷离 已提交
123
mainClassName = "io.github.dreamylost.Application"
梦境迷离's avatar
梦境迷离 已提交
124 125 126 127 128 129
[compileScala, compileTestScala]*.options*.encoding = 'UTF-8'

// 宏工具必须要配置编译参数
tasks.withType(ScalaCompile) {
    scalaCompileOptions.additionalParameters = ["-Ymacro-annotations"]
}