Setup Gradle multi-module build

Added core, config and samples modules. Moved sample project into samples module.

Closes gh-10
This commit is contained in:
Eleftheria Stein 2020-04-23 15:37:17 -04:00
parent c9a7fc124c
commit 5ed7c8f501
9 changed files with 58 additions and 14 deletions

View File

@ -23,7 +23,7 @@ jobs:
with:
java-version: ${{ matrix.jdk }}
- name: Build with Gradle
run: echo Starting build
run: ./gradlew clean build
snapshot_tests:
name: Test against snapshots
runs-on: ubuntu-latest

View File

@ -1,24 +1,28 @@
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
buildscript {
dependencies {
classpath 'io.spring.gradle:spring-build-conventions:0.0.31.RELEASE'
classpath "org.springframework.boot:spring-boot-gradle-plugin:latest.release"
}
repositories {
maven { url 'https://repo.spring.io/plugins-snapshot' }
maven { url 'https://plugins.gradle.org/m2/' }
}
}
apply plugin: 'io.spring.convention.root'
group = 'org.springframework.experimental'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
dependencyManagementExport.projects = subprojects
subprojects {
plugins.withType(JavaPlugin) {
project.sourceCompatibility = '1.8'
}
}
test {
useJUnitPlatform()
}

View File

@ -0,0 +1 @@
apply plugin: 'io.spring.convention.spring-module'

View File

@ -0,0 +1 @@
apply plugin: 'io.spring.convention.spring-module'

View File

@ -0,0 +1,11 @@
dependencyManagement {
imports {
mavenBom 'org.springframework:spring-framework-bom:latest.release'
}
dependencies {
dependency 'junit:junit:latest.release'
dependency 'org.assertj:assertj-core:latest.release'
dependency 'org.mockito:mockito-core:latest.release'
}
}

View File

@ -0,0 +1,12 @@
apply plugin: 'io.spring.convention.spring-sample-boot'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}

View File

@ -1 +1,16 @@
rootProject.name = 'spring-authorization-server'
FileTree buildFiles = fileTree(rootDir) {
include '**/*.gradle'
exclude 'build', '**/gradle', 'settings.gradle', 'buildSrc', '/build.gradle', '.*', 'out'
}
buildFiles.each { File buildFile ->
String projectName = buildFile.name.replace('.gradle', '');
String projectPath = ':' + projectName;
include projectPath
def project = findProject("${projectPath}")
project.name = projectName
project.projectDir = buildFile.parentFile
project.buildFileName = buildFile.name
}