diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 3b36874..e0c7964 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -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 diff --git a/build.gradle b/build.gradle index 8bd97c3..de09a73 100644 --- a/build.gradle +++ b/build.gradle @@ -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() -} diff --git a/config/spring-authorization-server-config.gradle b/config/spring-authorization-server-config.gradle new file mode 100644 index 0000000..56dcd79 --- /dev/null +++ b/config/spring-authorization-server-config.gradle @@ -0,0 +1 @@ +apply plugin: 'io.spring.convention.spring-module' diff --git a/core/spring-authorization-server-core.gradle b/core/spring-authorization-server-core.gradle new file mode 100644 index 0000000..56dcd79 --- /dev/null +++ b/core/spring-authorization-server-core.gradle @@ -0,0 +1 @@ +apply plugin: 'io.spring.convention.spring-module' diff --git a/gradle/dependency-management.gradle b/gradle/dependency-management.gradle new file mode 100644 index 0000000..188db8e --- /dev/null +++ b/gradle/dependency-management.gradle @@ -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' + } +} diff --git a/samples/helloworld/spring-authorization-server-samples-helloworld.gradle b/samples/helloworld/spring-authorization-server-samples-helloworld.gradle new file mode 100644 index 0000000..5300d84 --- /dev/null +++ b/samples/helloworld/spring-authorization-server-samples-helloworld.gradle @@ -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() +} diff --git a/src/main/java/sample/Application.java b/samples/helloworld/src/main/java/sample/Application.java similarity index 100% rename from src/main/java/sample/Application.java rename to samples/helloworld/src/main/java/sample/Application.java diff --git a/src/test/java/sample/ApplicationTest.java b/samples/helloworld/src/test/java/sample/ApplicationTest.java similarity index 100% rename from src/test/java/sample/ApplicationTest.java rename to samples/helloworld/src/test/java/sample/ApplicationTest.java diff --git a/settings.gradle b/settings.gradle index f3915b5..c2654bd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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 +}