Skip to content

Commit

Permalink
chore: remove multi-modules and example stub (#39)
Browse files Browse the repository at this point in the history
<!-- Thanks for opening a PR! Here are some quick tips:
If this is your first time contributing, [read our Contributing
Guidelines](https://github.com/openfga/.github/blob/main/CONTRIBUTING.md)
to learn how to create an acceptable PR for this repo.
By submitting a PR to this repository, you agree to the terms within the
[OpenFGA Code of
Conduct](https://github.com/openfga/.github/blob/main/CODE_OF_CONDUCT.md)

If your PR is under active development, please submit it as a "draft".
Once it's ready, open it up for review.
-->

<!-- Provide a brief summary of the changes -->

Removes the example stub and organizes repo as single gradle project.

## Description
<!-- Provide a detailed description of the changes -->

It seems there is difficulty in publishing a single module of a
multi-module project using the nexus plugin. Since the examples module
is currently just a stub, this change just removes that module and makes
this project a single gradle project.

We can add the example as a separate directory later and pull the
starter dependency from maven as the java SDK does.

## References
<!-- Provide a list of any applicable references here (GitHub Issue,
[OpenFGA RFC](https://github.com/openfga/rfcs), other PRs, etc..) -->

gradle-nexus/publish-plugin#84

## Review Checklist
- [x] I have clicked on ["allow edits by
maintainers"](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork).
- [ ] I have added documentation for new/changed functionality in this
PR or in a PR to [openfga.dev](https://github.com/openfga/openfga.dev)
[Provide a link to any relevant PRs in the references section above]
- [x] The correct base branch is being used, if not `main`
- [ ] I have added tests to validate that the change in functionality is
working as expected
  • Loading branch information
jimmyjames authored Apr 9, 2024
2 parents 023ca4f + abe49fb commit b50c934
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 62 deletions.
43 changes: 42 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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'
Expand Down
10 changes: 0 additions & 10 deletions examples/servlet/build.gradle

This file was deleted.

This file was deleted.

Empty file.
35 changes: 0 additions & 35 deletions openfga-spring-boot-starter/build.gradle

This file was deleted.

File renamed without changes.
5 changes: 1 addition & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
rootProject.name = 'fga-spring-boot-starter'

include 'openfga-spring-boot-starter'
include 'examples:servlet'
rootProject.name = 'openfga-spring-boot-starter'
File renamed without changes.
File renamed without changes.

0 comments on commit b50c934

Please sign in to comment.