From abe49fbd7479c4595f80e57126fa595235e106f1 Mon Sep 17 00:00:00 2001 From: Jim Anderson Date: Tue, 9 Apr 2024 14:23:04 -0500 Subject: [PATCH] chore: remove multi-modules and example stub --- build.gradle | 43 ++++++++++++++++++- examples/servlet/build.gradle | 10 ----- .../dev/openfga/example/ServletFgaApp.java | 12 ------ .../src/main/resources/application.yaml | 0 openfga-spring-boot-starter/build.gradle | 35 --------------- .../publish.gradle => publish.gradle | 0 settings.gradle | 5 +-- .../main/java/dev/openfga/OpenFga.java | 0 .../dev/openfga/OpenFgaCheckException.java | 0 .../ConditionalOnFgaProperties.java | 0 .../OpenFgaAutoConfiguration.java | 0 .../autoconfigure/OpenFgaProperties.java | 0 ...ot.autoconfigure.AutoConfiguration.imports | 0 .../test/java/dev/openfga/OpenFgaTest.java | 0 .../FgaAutoConfigurationTests.java | 0 15 files changed, 43 insertions(+), 62 deletions(-) delete mode 100644 examples/servlet/build.gradle delete mode 100644 examples/servlet/src/main/java/dev/openfga/example/ServletFgaApp.java delete mode 100644 examples/servlet/src/main/resources/application.yaml delete mode 100644 openfga-spring-boot-starter/build.gradle rename openfga-spring-boot-starter/publish.gradle => publish.gradle (100%) rename {openfga-spring-boot-starter/src => src}/main/java/dev/openfga/OpenFga.java (100%) rename {openfga-spring-boot-starter/src => src}/main/java/dev/openfga/OpenFgaCheckException.java (100%) rename {openfga-spring-boot-starter/src => src}/main/java/dev/openfga/autoconfigure/ConditionalOnFgaProperties.java (100%) rename {openfga-spring-boot-starter/src => src}/main/java/dev/openfga/autoconfigure/OpenFgaAutoConfiguration.java (100%) rename {openfga-spring-boot-starter/src => src}/main/java/dev/openfga/autoconfigure/OpenFgaProperties.java (100%) rename {openfga-spring-boot-starter/src => src}/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) rename {openfga-spring-boot-starter/src => src}/test/java/dev/openfga/OpenFgaTest.java (100%) rename {openfga-spring-boot-starter/src => src}/test/java/dev/openfga/autoconfigure/FgaAutoConfigurationTests.java (100%) diff --git a/build.gradle b/build.gradle index 9b95bd5..cc663dd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,9 @@ plugins { - id 'java' + id 'java-library' + id 'org.springframework.boot' version "${springBootVersion}" apply false + id 'io.spring.dependency-management' version "${springDependencyManagementVersion}" + + // quality id 'com.diffplug.spotless' version '6.25.0' id 'jacoco' @@ -9,6 +13,43 @@ plugins { id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' } +apply from: 'publish.gradle' + +java { + sourceCompatibility = 17 + targetCompatibility = 17 + + withJavadocJar() + withSourcesJar() +} + +repositories { + mavenCentral() +} + +dependencyManagement { + imports { + mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES + } +} + +dependencies { + implementation 'org.springframework.boot:spring-boot' + implementation 'org.springframework.boot:spring-boot-autoconfigure' + implementation 'org.springframework.boot:spring-boot-starter-security' + + api 'dev.openfga:openfga-sdk:0.4.0' + + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.springframework.security:spring-security-test' + testImplementation 'org.hamcrest:hamcrest:2.2' + testImplementation 'org.mockito:mockito-core:5.11.0' +} + +test { + useJUnitPlatform() +} + subprojects { apply plugin: 'java' apply plugin: 'com.diffplug.spotless' diff --git a/examples/servlet/build.gradle b/examples/servlet/build.gradle deleted file mode 100644 index c34d6a3..0000000 --- a/examples/servlet/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -plugins { - id 'java' - id 'org.springframework.boot' version "${springBootVersion}" - id 'io.spring.dependency-management' version "${springDependencyManagementVersion}" -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation project(':openfga-spring-boot-starter') -} diff --git a/examples/servlet/src/main/java/dev/openfga/example/ServletFgaApp.java b/examples/servlet/src/main/java/dev/openfga/example/ServletFgaApp.java deleted file mode 100644 index 7d1a7b1..0000000 --- a/examples/servlet/src/main/java/dev/openfga/example/ServletFgaApp.java +++ /dev/null @@ -1,12 +0,0 @@ -package dev.openfga.example; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class ServletFgaApp { - - public static void main(String[] args) { - SpringApplication.run(ServletFgaApp.class, args); - } -} diff --git a/examples/servlet/src/main/resources/application.yaml b/examples/servlet/src/main/resources/application.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/openfga-spring-boot-starter/build.gradle b/openfga-spring-boot-starter/build.gradle deleted file mode 100644 index 7375b0d..0000000 --- a/openfga-spring-boot-starter/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id 'java-library' - id 'org.springframework.boot' version "${springBootVersion}" apply false - id 'io.spring.dependency-management' version "${springDependencyManagementVersion}" -} - -apply from: 'publish.gradle' - -java { - withJavadocJar() - withSourcesJar() -} - -dependencyManagement { - imports { - mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES - } -} - -dependencies { - implementation 'org.springframework.boot:spring-boot' - implementation 'org.springframework.boot:spring-boot-autoconfigure' - implementation 'org.springframework.boot:spring-boot-starter-security' - - api 'dev.openfga:openfga-sdk:0.4.0' - - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'org.springframework.security:spring-security-test' - testImplementation 'org.hamcrest:hamcrest:2.2' - testImplementation 'org.mockito:mockito-core:5.11.0' -} - -test { - useJUnitPlatform() -} diff --git a/openfga-spring-boot-starter/publish.gradle b/publish.gradle similarity index 100% rename from openfga-spring-boot-starter/publish.gradle rename to publish.gradle diff --git a/settings.gradle b/settings.gradle index 1ed8f97..30aa7b3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1 @@ -rootProject.name = 'fga-spring-boot-starter' - -include 'openfga-spring-boot-starter' -include 'examples:servlet' +rootProject.name = 'openfga-spring-boot-starter' diff --git a/openfga-spring-boot-starter/src/main/java/dev/openfga/OpenFga.java b/src/main/java/dev/openfga/OpenFga.java similarity index 100% rename from openfga-spring-boot-starter/src/main/java/dev/openfga/OpenFga.java rename to src/main/java/dev/openfga/OpenFga.java diff --git a/openfga-spring-boot-starter/src/main/java/dev/openfga/OpenFgaCheckException.java b/src/main/java/dev/openfga/OpenFgaCheckException.java similarity index 100% rename from openfga-spring-boot-starter/src/main/java/dev/openfga/OpenFgaCheckException.java rename to src/main/java/dev/openfga/OpenFgaCheckException.java diff --git a/openfga-spring-boot-starter/src/main/java/dev/openfga/autoconfigure/ConditionalOnFgaProperties.java b/src/main/java/dev/openfga/autoconfigure/ConditionalOnFgaProperties.java similarity index 100% rename from openfga-spring-boot-starter/src/main/java/dev/openfga/autoconfigure/ConditionalOnFgaProperties.java rename to src/main/java/dev/openfga/autoconfigure/ConditionalOnFgaProperties.java diff --git a/openfga-spring-boot-starter/src/main/java/dev/openfga/autoconfigure/OpenFgaAutoConfiguration.java b/src/main/java/dev/openfga/autoconfigure/OpenFgaAutoConfiguration.java similarity index 100% rename from openfga-spring-boot-starter/src/main/java/dev/openfga/autoconfigure/OpenFgaAutoConfiguration.java rename to src/main/java/dev/openfga/autoconfigure/OpenFgaAutoConfiguration.java diff --git a/openfga-spring-boot-starter/src/main/java/dev/openfga/autoconfigure/OpenFgaProperties.java b/src/main/java/dev/openfga/autoconfigure/OpenFgaProperties.java similarity index 100% rename from openfga-spring-boot-starter/src/main/java/dev/openfga/autoconfigure/OpenFgaProperties.java rename to src/main/java/dev/openfga/autoconfigure/OpenFgaProperties.java diff --git a/openfga-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from openfga-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/openfga-spring-boot-starter/src/test/java/dev/openfga/OpenFgaTest.java b/src/test/java/dev/openfga/OpenFgaTest.java similarity index 100% rename from openfga-spring-boot-starter/src/test/java/dev/openfga/OpenFgaTest.java rename to src/test/java/dev/openfga/OpenFgaTest.java diff --git a/openfga-spring-boot-starter/src/test/java/dev/openfga/autoconfigure/FgaAutoConfigurationTests.java b/src/test/java/dev/openfga/autoconfigure/FgaAutoConfigurationTests.java similarity index 100% rename from openfga-spring-boot-starter/src/test/java/dev/openfga/autoconfigure/FgaAutoConfigurationTests.java rename to src/test/java/dev/openfga/autoconfigure/FgaAutoConfigurationTests.java