Update Gradle build-tool (#37)

This commit is contained in:
Michał Siatkowski
2022-08-09 19:14:34 +02:00
committed by GitHub
parent 929240a494
commit 1b254f8ed5
12 changed files with 67 additions and 84 deletions

View File

@@ -27,9 +27,9 @@ steps:
from_secret: docker_password from_secret: docker_password
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
context: docker/ context: docker/
when: when:
branch: master branch: master
event: push event: push
- name: deploy_and_restart - name: deploy_and_restart
image: appleboy/drone-ssh image: appleboy/drone-ssh

1
.gitignore vendored
View File

@@ -87,6 +87,7 @@ cmake-build-release/
# IntelliJ # IntelliJ
out/ out/
build/
# mpeltonen/sbt-idea plugin # mpeltonen/sbt-idea plugin
.idea_modules/ .idea_modules/

View File

@@ -29,5 +29,11 @@ to the same folder and rename it to **secrets.env**
``` ```
11. Send `/start` command to your bot 11. Send `/start` command to your bot
### Develop run
1. Run `docker-compose up` to launch PostgreSQL database
2. Set env `TELEGRAM_TOKEN="YOUR_TOKEN"`
3. Run `Boot.scala` app

View File

@@ -1,7 +1,7 @@
dependencies { dependencies {
compile project(':common') implementation project(':common')
compile group: "org.scalaj", name: "scalaj-http_2.12", version: "2.4.2" api "org.scalaj:scalaj-http_$scala:2.4.2"
compile group: "org.json4s", name: "json4s-jackson_2.12", version: "3.6.0-M3" api "org.json4s:json4s-jackson_$scala:3.6.0-M3"
compile group: "com.softwaremill.quicklens", name: "quicklens_2.12", version: "1.4.12" api "com.softwaremill.quicklens:quicklens_$scala:1.4.12"
} }

View File

@@ -1,6 +1,5 @@
dependencies { dependencies {
compile project(':common') implementation project(':common')
compile group: "com.bot4s", name: "telegram-core_2.12", version: "5.6.0" api "com.bot4s:telegram-akka_$scala:5.6.0"
compile group: "com.bot4s", name: "telegram-akka_2.12", version: "5.6.0"
} }

View File

@@ -1,49 +1,24 @@
group = 'com.lbs' plugins {
id "com.github.maiflai.scalatest" version "0.32"
ext { id "org.springframework.boot" version "2.7.2"
scalaVersion = "2.12.8"
} }
allprojects { allprojects {
group = 'com.lbs' apply plugin: "scala"
} apply plugin: "java-library"
apply plugin: "com.github.maiflai.scalatest"
apply plugin: 'idea'
subprojects {
idea {
module {
downloadSources = true
}
}
repositories { repositories {
mavenCentral() mavenCentral()
jcenter() maven { url "https://repo.spring.io/libs-milestone" }
maven { url 'https://repo.spring.io/libs-milestone' }
} }
apply plugin: 'java'
apply plugin: 'scala'
dependencies { dependencies {
compile group: 'org.scala-lang', name: "scala-library", version: scalaVersion compileOnly "org.scala-lang:scala-library:$scala.$scala_minor"
testCompile('org.scalatest:scalatest_2.12:3.0.4') testImplementation "org.scalatest:scalatest_$scala:3.0.4"
testCompile('org.mockito:mockito-core:2.13.0')
testCompile('org.pegdown:pegdown:1.6.0') testImplementation "org.mockito:mockito-core:2.13.0"
testImplementation "org.pegdown:pegdown:1.6.0"
} }
task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
main = 'org.scalatest.tools.Runner'
args = ['-R', "build/classes/scala/test",
'-u', "build/test-results/$name",
'-h', "build/resports/scalaTests/$name",
'-o'
]
classpath = sourceSets.test.runtimeClasspath
}
test.dependsOn scalaTest
} }

View File

@@ -1,6 +1,5 @@
dependencies { dependencies {
compile group: "org.slf4j", name: "slf4j-api", version: "1.7.25" api "org.slf4j:slf4j-api:1.7.25"
compile group: "ch.qos.logback", name: "logback-classic", version: "1.2.3" api "ch.qos.logback:logback-classic:1.2.3"
compile group: "ch.qos.logback", name: "logback-core", version: "1.2.3" api "org.typelevel:cats-core_$scala:2.0.0-M1"
compile("org.typelevel:cats-core_2.12:2.0.0-M1")
} }

11
docker-compose.yml Normal file
View File

@@ -0,0 +1,11 @@
version: '3.4'
services:
database:
image: postgres:10.6
ports:
- "5432:5432"
environment:
- POSTGRES_USER=lbs
- POSTGRES_PASSWORD=lsb123
- POSTGRES_DB=lbs
- TZ=Europe/Warsaw

View File

@@ -2,3 +2,6 @@ org.gradle.daemon=true
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.configureondemand=true org.gradle.configureondemand=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 org.gradle.jvmargs=-Dfile.encoding=UTF-8
scala=2.12
scala_minor=16

View File

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip

View File

@@ -1,39 +1,26 @@
buildscript { apply plugin: "org.springframework.boot"
ext { apply plugin: "io.spring.dependency-management"
springBootVersion = '2.1.1.RELEASE'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
dependencies { dependencies {
compile project(':api') implementation project(":api")
compile project(':bot') implementation project(":bot")
compile project(':common') implementation project(":common")
compile('com.lihaoyi:sourcecode_2.12:0.1.4') implementation "com.lihaoyi:sourcecode_$scala:0.1.4"
compile('org.springframework.boot:spring-boot-starter') implementation "org.springframework.boot:spring-boot-starter"
compile('org.springframework.boot:spring-boot-starter-data-jpa') implementation "org.springframework.boot:spring-boot-starter-data-jpa"
compile('org.liquibase:liquibase-core') implementation "org.liquibase:liquibase-core"
compile('org.jasypt:jasypt:1.9.2') implementation "org.jasypt:jasypt:1.9.2"
compile('org.postgresql:postgresql:42.2.1.jre7') implementation "org.postgresql:postgresql:42.2.26"
testImplementation('com.typesafe.akka:akka-testkit_2.12:2.6.19') testImplementation "com.typesafe.akka:akka-testkit_$scala:2.6.19"
testImplementation('org.springframework.boot:spring-boot-starter-test') testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation('com.h2database:h2') testImplementation "com.h2database:h2"
runtime group: "org.jetbrains.kotlin", name: "kotlin-stdlib", version: "1.4.10"
// fixme: remove junit
testImplementation 'junit:junit:4.13.2'
} }
task prepare(type: Copy) { task prepare(type: Copy) {

View File

@@ -13,6 +13,8 @@ spring:
generate-ddl: "false" generate-ddl: "false"
liquibase: liquibase:
change-log: classpath:db/liquibase-changelog.yml change-log: classpath:db/liquibase-changelog.yml
main:
allow-circular-references: true
banner: banner:
location: "classpath:/banner.txt" location: "classpath:/banner.txt"