diff --git a/api/build.gradle.kts b/api/build.gradle.kts new file mode 100644 index 0000000..711037e --- /dev/null +++ b/api/build.gradle.kts @@ -0,0 +1,58 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.net.URI + +buildscript { + repositories { + mavenLocal() + mavenCentral() +// maven { +// url = URI("https://repo.maven.apache.org/maven2") +// } + } + + dependencies { + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61") + } +} + +plugins { + java + kotlin("jvm") version "1.3.61" + id("org.springframework.boot") version "2.2.4.RELEASE" +} + +apply(plugin = "io.spring.dependency-management") + +repositories { + mavenLocal() + mavenCentral() + maven { + url = URI("http://repo.maven.apache.org/maven2") + } +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-data-jpa") + implementation("org.springframework.boot:spring-boot-starter-security") + implementation("org.springframework.session:spring-session-jdbc") + implementation("org.springframework.boot:spring-boot-starter-web") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8") + implementation("org.jetbrains.kotlin:kotlin-reflect:1.3.61") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61") + implementation("io.springfox:springfox-swagger2:2.8.0") + implementation("io.springfox:springfox-swagger-ui:2.8.0") + runtimeOnly("mysql:mysql-connector-java:8.0.15") + testImplementation("org.springframework.boot:spring-boot-starter-test") + testImplementation("org.springframework.security:spring-security-test:5.1.5.RELEASE") +} + +description = "twigs-server" + +val mainClass = "com.wbrawner.budgetserver.BudgetServerApplication" +tasks.bootJar { + mainClassName = mainClass +} + +tasks.bootRun { + main = mainClass +} diff --git a/src/main/kotlin/com/wbrawner/budgetserver/BudgetServerApplication.kt b/api/src/main/java/com/wbrawner/budgetserver/BudgetServerApplication.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/BudgetServerApplication.kt rename to api/src/main/java/com/wbrawner/budgetserver/BudgetServerApplication.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/ErrorResponse.kt b/api/src/main/java/com/wbrawner/budgetserver/ErrorResponse.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/ErrorResponse.kt rename to api/src/main/java/com/wbrawner/budgetserver/ErrorResponse.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/Utils.kt b/api/src/main/java/com/wbrawner/budgetserver/Utils.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/Utils.kt rename to api/src/main/java/com/wbrawner/budgetserver/Utils.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/budget/Budget.kt b/api/src/main/java/com/wbrawner/budgetserver/budget/Budget.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/budget/Budget.kt rename to api/src/main/java/com/wbrawner/budgetserver/budget/Budget.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/budget/BudgetController.kt b/api/src/main/java/com/wbrawner/budgetserver/budget/BudgetController.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/budget/BudgetController.kt rename to api/src/main/java/com/wbrawner/budgetserver/budget/BudgetController.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/budget/BudgetRepository.kt b/api/src/main/java/com/wbrawner/budgetserver/budget/BudgetRepository.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/budget/BudgetRepository.kt rename to api/src/main/java/com/wbrawner/budgetserver/budget/BudgetRepository.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/category/Category.kt b/api/src/main/java/com/wbrawner/budgetserver/category/Category.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/category/Category.kt rename to api/src/main/java/com/wbrawner/budgetserver/category/Category.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/category/CategoryController.kt b/api/src/main/java/com/wbrawner/budgetserver/category/CategoryController.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/category/CategoryController.kt rename to api/src/main/java/com/wbrawner/budgetserver/category/CategoryController.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/category/CategoryRepository.kt b/api/src/main/java/com/wbrawner/budgetserver/category/CategoryRepository.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/category/CategoryRepository.kt rename to api/src/main/java/com/wbrawner/budgetserver/category/CategoryRepository.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/config/JdbcUserDetailsService.kt b/api/src/main/java/com/wbrawner/budgetserver/config/JdbcUserDetailsService.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/config/JdbcUserDetailsService.kt rename to api/src/main/java/com/wbrawner/budgetserver/config/JdbcUserDetailsService.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/config/SecurityConfig.kt b/api/src/main/java/com/wbrawner/budgetserver/config/SecurityConfig.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/config/SecurityConfig.kt rename to api/src/main/java/com/wbrawner/budgetserver/config/SecurityConfig.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/config/SwaggerConfig.kt b/api/src/main/java/com/wbrawner/budgetserver/config/SwaggerConfig.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/config/SwaggerConfig.kt rename to api/src/main/java/com/wbrawner/budgetserver/config/SwaggerConfig.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/passwordresetrequest/PasswordResetRequest.kt b/api/src/main/java/com/wbrawner/budgetserver/passwordresetrequest/PasswordResetRequest.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/passwordresetrequest/PasswordResetRequest.kt rename to api/src/main/java/com/wbrawner/budgetserver/passwordresetrequest/PasswordResetRequest.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/passwordresetrequest/PasswordResetRequestRepository.kt b/api/src/main/java/com/wbrawner/budgetserver/passwordresetrequest/PasswordResetRequestRepository.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/passwordresetrequest/PasswordResetRequestRepository.kt rename to api/src/main/java/com/wbrawner/budgetserver/passwordresetrequest/PasswordResetRequestRepository.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/permission/UserPermission.kt b/api/src/main/java/com/wbrawner/budgetserver/permission/UserPermission.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/permission/UserPermission.kt rename to api/src/main/java/com/wbrawner/budgetserver/permission/UserPermission.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/permission/UserPermissionRepository.kt b/api/src/main/java/com/wbrawner/budgetserver/permission/UserPermissionRepository.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/permission/UserPermissionRepository.kt rename to api/src/main/java/com/wbrawner/budgetserver/permission/UserPermissionRepository.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/transaction/Transaction.kt b/api/src/main/java/com/wbrawner/budgetserver/transaction/Transaction.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/transaction/Transaction.kt rename to api/src/main/java/com/wbrawner/budgetserver/transaction/Transaction.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionController.kt b/api/src/main/java/com/wbrawner/budgetserver/transaction/TransactionController.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionController.kt rename to api/src/main/java/com/wbrawner/budgetserver/transaction/TransactionController.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionRepository.kt b/api/src/main/java/com/wbrawner/budgetserver/transaction/TransactionRepository.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionRepository.kt rename to api/src/main/java/com/wbrawner/budgetserver/transaction/TransactionRepository.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/user/User.kt b/api/src/main/java/com/wbrawner/budgetserver/user/User.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/user/User.kt rename to api/src/main/java/com/wbrawner/budgetserver/user/User.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/user/UserController.kt b/api/src/main/java/com/wbrawner/budgetserver/user/UserController.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/user/UserController.kt rename to api/src/main/java/com/wbrawner/budgetserver/user/UserController.kt diff --git a/src/main/kotlin/com/wbrawner/budgetserver/user/UserRepository.kt b/api/src/main/java/com/wbrawner/budgetserver/user/UserRepository.kt similarity index 100% rename from src/main/kotlin/com/wbrawner/budgetserver/user/UserRepository.kt rename to api/src/main/java/com/wbrawner/budgetserver/user/UserRepository.kt diff --git a/src/main/resources/application.properties b/api/src/main/resources/application.properties similarity index 100% rename from src/main/resources/application.properties rename to api/src/main/resources/application.properties diff --git a/src/test/kotlin/com/wbrawner/budgetserver/BudgetServerApplicationTests.kt b/api/src/test/java/com/wbrawner/budgetserver/BudgetServerApplicationTests.kt similarity index 100% rename from src/test/kotlin/com/wbrawner/budgetserver/BudgetServerApplicationTests.kt rename to api/src/test/java/com/wbrawner/budgetserver/BudgetServerApplicationTests.kt diff --git a/build.gradle.kts b/build.gradle.kts index 3fe06de..9305cf7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,9 +5,6 @@ buildscript { repositories { mavenLocal() mavenCentral() -// maven { -// url = URI("https://repo.maven.apache.org/maven2") -// } } dependencies { @@ -23,46 +20,22 @@ plugins { apply(plugin = "io.spring.dependency-management") -repositories { - mavenLocal() - mavenCentral() - maven { - url = URI("http://repo.maven.apache.org/maven2") +allprojects { + repositories { + mavenLocal() + mavenCentral() + maven { + url = URI("http://repo.maven.apache.org/maven2") + } + } + group = "com.wbrawner" + version = "0.0.1-SNAPSHOT" + + sourceSets.getByName("main") { + java.srcDir("src/main/kotlin") + } + + tasks.withType { + kotlinOptions.jvmTarget = "14" } } - -dependencies { - implementation("org.springframework.boot:spring-boot-starter-data-jpa") - implementation("org.springframework.boot:spring-boot-starter-security") - implementation("org.springframework.session:spring-session-jdbc") - implementation("org.springframework.boot:spring-boot-starter-web") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8") - implementation("org.jetbrains.kotlin:kotlin-reflect:1.3.61") - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61") - implementation("io.springfox:springfox-swagger2:2.8.0") - implementation("io.springfox:springfox-swagger-ui:2.8.0") - runtimeOnly("mysql:mysql-connector-java:8.0.15") - testImplementation("org.springframework.boot:spring-boot-starter-test") - testImplementation("org.springframework.security:spring-security-test:5.1.5.RELEASE") -} - -group = "com.wbrawner" -version = "0.0.1-SNAPSHOT" -description = "twigs-server" - -sourceSets.getByName("main") { - java.srcDir("src/main/kotlin") -} - -tasks.withType { - kotlinOptions.jvmTarget = "11" -} - -val mainClass = "com.wbrawner.budgetserver.BudgetServerApplication" -tasks.bootJar { - mainClassName = mainClass -} - -tasks.bootRun { - main = mainClass -} diff --git a/settings.gradle b/settings.gradle index 40507ab..7881ed3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,4 +2,5 @@ * This file was generated by the Gradle 'init' task. */ -rootProject.name = 'budget-server' +rootProject.name = 'twigs' +include ':api' \ No newline at end of file