diff --git a/uhabits-server/build.gradle b/uhabits-server/build.gradle deleted file mode 100644 index d1e033e93..000000000 --- a/uhabits-server/build.gradle +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2016-2021 Álinson Santos Xavier - * - * This file is part of Loop Habit Tracker. - * - * Loop Habit Tracker is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or (at your - * option) any later version. - * - * Loop Habit Tracker is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -buildscript { - repositories { - jcenter() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.github.jengelman.gradle.plugins:shadow:5.2.0" - classpath "com.palantir.gradle.docker:gradle-docker:0.25.0" - } -} - -apply plugin: 'kotlin' -apply plugin: "com.github.johnrengelman.shadow" -apply plugin: 'application' -apply plugin: "com.palantir.docker" -apply plugin: "com.palantir.docker-run" - -group 'org.isoron.uhabits' -version '0.0.1' -mainClassName = "io.ktor.server.netty.EngineMain" - -sourceSets { - main.kotlin.srcDirs = main.java.srcDirs = ['src'] - test.kotlin.srcDirs = test.java.srcDirs = ['test'] - main.resources.srcDirs = ['resources'] - test.resources.srcDirs = ['testresources'] -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation "io.ktor:ktor-server-netty:$ktor_version" - implementation "ch.qos.logback:logback-classic:$logback_version" - implementation "io.ktor:ktor-server-core:$ktor_version" - implementation "io.ktor:ktor-html-builder:$ktor_version" - implementation "io.ktor:ktor-jackson:$ktor_version" - implementation "org.jetbrains:kotlin-css-jvm:1.0.0-pre.31-kotlin-1.2.41" - implementation "io.prometheus:simpleclient:0.9.0" - implementation "io.prometheus:simpleclient_httpserver:0.9.0" - implementation "io.prometheus:simpleclient_hotspot:0.9.0" - testImplementation "io.ktor:ktor-server-tests:$ktor_version" - testImplementation "org.mockito:mockito-core:2.+" -} - -shadowJar { - baseName = 'uhabits-server' - classifier = null - version = null -} - -docker { - name = "docker.axavier.org/uhabits-server:$version" - files "build/libs/uhabits-server.jar" -} - -dockerRun { - name = 'uhabits-server' - image "uhabits-server:$version" - ports '8080:8080' - daemonize false - clean true -} \ No newline at end of file diff --git a/uhabits-server/build.gradle.kts b/uhabits-server/build.gradle.kts new file mode 100644 index 000000000..7f246d916 --- /dev/null +++ b/uhabits-server/build.gradle.kts @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2016-2021 Álinson Santos Xavier + * + * This file is part of Loop Habit Tracker. + * + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + +plugins { + application + id("kotlin") + id("com.github.johnrengelman.shadow") version "6.1.0" +} + + +application { + group = "org.isoron.uhabits" + version = "0.0.1" + mainClassName = "io.ktor.server.netty.EngineMain" +} + +dependencies { + val ktorVersion = "1.4.1" + val kotlinVersion = "1.4.10" + val logbackVersion = "1.2.1" + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") + implementation("io.ktor:ktor-server-netty:$ktorVersion") + implementation("ch.qos.logback:logback-classic:$logbackVersion") + implementation("io.ktor:ktor-server-core:$ktorVersion") + implementation("io.ktor:ktor-html-builder:$ktorVersion") + implementation("io.ktor:ktor-jackson:$ktorVersion") + implementation("org.jetbrains:kotlin-css-jvm:1.0.0-pre.31-kotlin-1.2.41") + implementation("io.prometheus:simpleclient:0.9.0") + implementation("io.prometheus:simpleclient_httpserver:0.9.0") + implementation("io.prometheus:simpleclient_hotspot:0.9.0") + testImplementation("io.ktor:ktor-server-tests:$ktorVersion") + testImplementation("org.mockito:mockito-core:2.28.2") +} + +tasks.withType { + archiveBaseName.set("uhabits-server") + archiveClassifier.set("") + archiveVersion.set("") +} diff --git a/uhabits-server/gradle.properties b/uhabits-server/gradle.properties deleted file mode 100644 index f7235a299..000000000 --- a/uhabits-server/gradle.properties +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (C) 2016-2021 Álinson Santos Xavier -# -# This file is part of Loop Habit Tracker. -# -# Loop Habit Tracker is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# Loop Habit Tracker is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# - -ktor_version=1.4.1 -kotlin.code.style=official -kotlin_version=1.4.10 -logback_version=1.2.1 diff --git a/uhabits-server/src/org/isoron/uhabits/sync/SyncData.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/SyncData.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/SyncData.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/SyncData.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/SyncException.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/SyncException.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/SyncException.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/SyncException.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/app/LinkModule.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/LinkModule.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/app/LinkModule.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/LinkModule.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/app/MetricsModule.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/MetricsModule.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/app/MetricsModule.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/MetricsModule.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/app/RegistrationModule.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/RegistrationModule.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/app/RegistrationModule.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/RegistrationModule.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/app/StorageModule.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/StorageModule.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/app/StorageModule.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/StorageModule.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/app/SyncApplication.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/SyncApplication.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/app/SyncApplication.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/app/SyncApplication.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/links/Link.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/links/Link.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/links/Link.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/links/Link.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/links/LinkManager.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/links/LinkManager.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/links/LinkManager.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/links/LinkManager.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/repository/FileRepository.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/repository/FileRepository.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/repository/FileRepository.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/repository/FileRepository.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/repository/Repository.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/repository/Repository.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/repository/Repository.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/repository/Repository.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/server/AbstractSyncServer.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/server/AbstractSyncServer.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/server/AbstractSyncServer.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/server/AbstractSyncServer.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/server/RepositorySyncServer.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/server/RepositorySyncServer.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/server/RepositorySyncServer.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/server/RepositorySyncServer.kt diff --git a/uhabits-server/src/org/isoron/uhabits/sync/utils/String.kt b/uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/utils/String.kt similarity index 100% rename from uhabits-server/src/org/isoron/uhabits/sync/utils/String.kt rename to uhabits-server/src/main/kotlin/org/isoron/uhabits/sync/utils/String.kt diff --git a/uhabits-server/resources/application.conf b/uhabits-server/src/main/resources/application.conf similarity index 100% rename from uhabits-server/resources/application.conf rename to uhabits-server/src/main/resources/application.conf diff --git a/uhabits-server/resources/logback.xml b/uhabits-server/src/main/resources/logback.xml similarity index 100% rename from uhabits-server/resources/logback.xml rename to uhabits-server/src/main/resources/logback.xml diff --git a/uhabits-server/test/org/isoron/uhabits/sync/app/BaseApplicationTest.kt b/uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/app/BaseApplicationTest.kt similarity index 100% rename from uhabits-server/test/org/isoron/uhabits/sync/app/BaseApplicationTest.kt rename to uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/app/BaseApplicationTest.kt diff --git a/uhabits-server/test/org/isoron/uhabits/sync/app/LinksModuleTest.kt b/uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/app/LinksModuleTest.kt similarity index 100% rename from uhabits-server/test/org/isoron/uhabits/sync/app/LinksModuleTest.kt rename to uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/app/LinksModuleTest.kt diff --git a/uhabits-server/test/org/isoron/uhabits/sync/app/RegistrationModuleTest.kt b/uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/app/RegistrationModuleTest.kt similarity index 100% rename from uhabits-server/test/org/isoron/uhabits/sync/app/RegistrationModuleTest.kt rename to uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/app/RegistrationModuleTest.kt diff --git a/uhabits-server/test/org/isoron/uhabits/sync/app/StorageModuleTest.kt b/uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/app/StorageModuleTest.kt similarity index 100% rename from uhabits-server/test/org/isoron/uhabits/sync/app/StorageModuleTest.kt rename to uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/app/StorageModuleTest.kt diff --git a/uhabits-server/test/org/isoron/uhabits/sync/links/LinkManagerTest.kt b/uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/links/LinkManagerTest.kt similarity index 100% rename from uhabits-server/test/org/isoron/uhabits/sync/links/LinkManagerTest.kt rename to uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/links/LinkManagerTest.kt diff --git a/uhabits-server/test/org/isoron/uhabits/sync/repository/FileRepositoryTest.kt b/uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/repository/FileRepositoryTest.kt similarity index 100% rename from uhabits-server/test/org/isoron/uhabits/sync/repository/FileRepositoryTest.kt rename to uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/repository/FileRepositoryTest.kt diff --git a/uhabits-server/test/org/isoron/uhabits/sync/server/RepositorySyncServerTest.kt b/uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/server/RepositorySyncServerTest.kt similarity index 100% rename from uhabits-server/test/org/isoron/uhabits/sync/server/RepositorySyncServerTest.kt rename to uhabits-server/src/test/kotlin/org/isoron/uhabits/sync/server/RepositorySyncServerTest.kt