Skip to content

Commit

Permalink
Merge pull request #205 from trydofor/develop
Browse files Browse the repository at this point in the history
add qodana.yml; remove awesome,autogen module
  • Loading branch information
trydofor authored Feb 6, 2024
2 parents 99c5eb9 + 16123b8 commit f1d8e03
Show file tree
Hide file tree
Showing 134 changed files with 216 additions and 280 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Qodana
on:
workflow_dispatch:
push:
branches:
- 'main'

jobs:
qodana:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v4
- name: 'Qodana Scan'
uses: JetBrains/[email protected]
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
2 changes: 1 addition & 1 deletion example/winx-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>warlock-awesome</artifactId>
<artifactId>warlock</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
Expand Down
85 changes: 85 additions & 0 deletions observe/scripts/wings-testing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash

# check maven 3.5+
_ver_mvn=$(mvn --version | awk -F ' ' '/Apache Maven/ {print $3}')
IFS='.' read -r -a ptv <<< "$_ver_mvn"
if ((ptv[0] < 3)) || ((ptv[0] == 3 && ptv[1] < 9)); then
echo -e "\033[31mREQUIRE maven 3.9+, but $_ver_mvn \033[0m"
echo -e "asdf install maven 3.9.6[0m"
exit
fi

# check java 21+
_ver_jdk=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
IFS='.' read -r -a ptj <<< "$_ver_jdk"
if ((ptj[0] < 21)); then
echo -e "\033[31mREQUIRE java 21+, but $_ver_jdk \033[0m"
echo "asdf install java temurin-21.0.1+12.0.LTS"
exit
fi

if [[ "$MAVEN_OPTS" == "" ]]; then
MAVEN_OPTS="-Xmx2g"
fi

if [[ "$LOG_LEVEL" == "" ]]; then
echo -e "\033[32m log level (INFO)? [INFO|DEBUG|WARN|ERROR]\033[m"
read -r _ans </dev/tty
if [[ "$_ans" == "" ]] ;then
LOG_LEVEL="INFO"
else
LOG_LEVEL="$_ans"
fi
fi

if [[ "$TEST_VERBOSE" == "" ]]; then
if [[ "$LOG_LEVEL" == "DEBUG" ]];then
TEST_VERBOSE="true"
else
TEST_VERBOSE="false"
fi
fi

if [[ "$COVERALLS_DRYRUN" == "" ]]; then
echo -e "\033[32m dryrun coveralls (y)? [y|n]\033[m"
read -r _ans </dev/tty
if [[ "$_ans" == "" || "$_ans" == "y" ]]; then
COVERALLS_DRYRUN="true"
else
COVERALLS_DRYRUN="false"
fi
fi

this_file="$0"
# shellcheck disable=SC2164,SC2046
cd $(dirname "$this_file")
cd ../.. # to wings project dir

echo -e "\033[32m from which step (1) to run?\033[m"
echo "1 - clean install"
echo "2 - devs-initdb"
echo "3 - test"
echo "4 - coverage"
echo "5 - coverall report"
read -r _ans </dev/tty
_step=1;
if [[ "$_ans" != "" ]]; then
_step="$_ans"
fi
# ##############
echo "====================="
pwd
echo MAVEN_OPTS=$MAVEN_OPTS
echo LOG_LEVEL=$LOG_LEVEL
echo TEST_VERBOSE=$TEST_VERBOSE
echo COVERALLS_DRYRUN=$COVERALLS_DRYRUN
echo "FROM STEP $_step TO RUN"
echo "====================="
set -e
set -x
[[ "$_step" -le "1" ]] && mvn -P '!example,!devs' -Dmaven.test.skip=true clean install
[[ "$_step" -le "2" ]] && mvn -pl ':devs-codegen' -Ddevs-initdb=true clean test
[[ "$_step" -le "3" ]] && mvn -P 'coverage,!example,!devs' test
[[ "$_step" -le "4" ]] && mvn -pl ':devs-coverage' -am jacoco:report-aggregate
[[ "$_step" -le "5" ]] && mvn -pl ':devs-coverage' -DrepoToken=$COVERALLS_WINGS -DdryRun=$COVERALLS_DRYRUN verify

34 changes: 8 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.1</version> <!-- https://github.com/spring-projects/spring-boot/releases -->
<version>3.2.2</version> <!-- https://github.com/spring-projects/spring-boot/releases -->
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand All @@ -24,6 +24,7 @@
<revision>3.2.110-SNAPSHOT</revision>
<!-- https://docs.spring.io/spring-boot/docs/current/reference/html/dependency-versions.html -->
<spring-boot.version>3.2.2</spring-boot.version>
<!-- -->
<wings.version>${revision}</wings.version>
<!--suppress UnresolvedMavenProperty fulfill by directory-maven-plugin -->
<wings.rootdir>${highest-basedir}</wings.rootdir>
Expand Down Expand Up @@ -75,7 +76,9 @@
<lombok-maven-plugin.version>1.18.20.0</lombok-maven-plugin.version> <!-- https://github.com/awhitford/lombok.maven -->
<!-- java, kotlin sources -->
<source.srcMainJava>${project.basedir}/src/main/java</source.srcMainJava>
<source.srcMainJavaGen>${project.basedir}/src/main/java-gen</source.srcMainJavaGen>
<source.srcMainKotlin>${project.basedir}/src/main/kotlin</source.srcMainKotlin>
<source.srcMainKotlinGen>${project.basedir}/src/main/kotlin-gen</source.srcMainKotlinGen>
<source.srcTestJava>${project.basedir}/src/test/java</source.srcTestJava>
<source.srcTestKotlin>${project.basedir}/src/test/kotlin</source.srcTestKotlin>
<!-- delombok: javadoc cannot find symbol -->
Expand Down Expand Up @@ -158,16 +161,6 @@
<artifactId>faceless</artifactId>
<version>${wings.version}</version>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>faceless-autogen</artifactId>
<version>${wings.version}</version>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>faceless-awesome</artifactId>
<version>${wings.version}</version>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>faceless-flywave</artifactId>
Expand Down Expand Up @@ -218,16 +211,6 @@
<artifactId>warlock</artifactId>
<version>${wings.version}</version>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>warlock-autogen</artifactId>
<version>${wings.version}</version>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>warlock-awesome</artifactId>
<version>${wings.version}</version>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>warlock-bond</artifactId>
Expand Down Expand Up @@ -284,11 +267,6 @@
<version>${wings.version}</version>
</dependency>
<!-- pro.fessional.wings radiant -->
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>tiny-autogen</artifactId>
<version>${wings.version}</version>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>tiny-task</artifactId>
Expand Down Expand Up @@ -761,7 +739,9 @@
<configuration>
<sources>
<source>${source.srcMainKotlin}</source>
<source>${source.srcMainKotlinGen}</source>
<source>${source.srcMainJava}</source>
<source>${source.srcMainJavaGen}</source>
</sources>
</configuration>
</execution>
Expand Down Expand Up @@ -978,7 +958,9 @@
<configuration>
<sourceDirs>
<sourceDir>${source.srcMainKotlin}</sourceDir>
<sourceDir>${source.srcMainKotlinGen}</sourceDir>
<sourceDir>${source.srcMainJava}</sourceDir>
<sourceDir>${source.srcMainJavaGen}</sourceDir>
</sourceDirs>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author trydofor
* @since 2023-01-23
*/
@SpringBootTest
@SpringBootTest(properties = "testing.dbname=wings")
@EnabledIfSystemProperty(named = "devs-autogen", matches = "true")
@TestMethodOrder(MethodOrderer.MethodName.class)
public class AutogenCodeTest {
Expand All @@ -51,17 +51,17 @@ void autogen01AllTestJooq() {
void autogen01AllMainCode() {
autogen01AllMainJooq();

autogen10FacelessAutogen();// faceless-autogen/enums
autogen20WarlockAutogenEnum();// warlock-autogen/enums
autogen20WarlockAutogenAuth();// warlock-autogen/security
autogen10FacelessAutogen();// faceless/enums
autogen20WarlockAutogenEnum();// warlock/enums
autogen20WarlockAutogenAuth();// warlock/security
}

@Test
@Disabled("call by autogen01AllMainCode")
void autogen01AllMainJooq() {
autogen21WarlockAutogenJooq();// warlock-autogen/database
autogen31TinyMailAutogenJooq();// tiny-autogen/mail
autogen31TinyTaskAutogenJooq();// tiny-autogen/task
autogen21WarlockAutogenJooq();// warlock/database
autogen31TinyMailAutogenJooq();// tiny/mail
autogen31TinyTaskAutogenJooq();// tiny/task
}

// ////////////////// individual test //////////////////
Expand All @@ -72,7 +72,7 @@ void autogen10FacelessAutogen() {
final JdbcDataLoadHelper helper = JdbcDataLoadHelper.use(dataSource);
final List<ConstantEnumGenerator.ConstantEnum> enums = ConstantEnumJdbcLoader.load(helper);
ConstantEnumGenerator.builder()
.targetDirectory(projectRoot + "wings/faceless-autogen/src/main/java/")
.targetDirectory(projectRoot + "wings/faceless/src/main/java-gen/")
.targetPackage("pro.fessional.wings.faceless.enums.autogen")
.includeType(ProjectEnumGenerator.facelessEnums)
.generate(enums);
Expand Down Expand Up @@ -105,7 +105,8 @@ void autogen11FacelessShardTest() {
@Disabled("call by autogen01AllMainCode")
void autogen20WarlockAutogenEnum() {
Warlock2EnumGenerator generator = new Warlock2EnumGenerator();
generator.setTargetDir(projectRoot + "wings/warlock-autogen/src/main/java/");
generator.setTargetDir(projectRoot + "wings/warlock/src/main/java-gen/");
generator.setTargetPkg("pro.fessional.wings.warlock.enums.autogen");
generator.gen(jdbcUrl, jdbcUser, jdbcPass,
h -> h.includeType(Warlock2EnumGenerator.warlockEnums));
}
Expand All @@ -115,7 +116,8 @@ void autogen20WarlockAutogenEnum() {
void autogen20WarlockAutogenAuth() {
JdbcDataLoadHelper helper = JdbcDataLoadHelper.use(jdbcUrl, jdbcUser, jdbcPass);
Warlock4AuthGenerator generator = new Warlock4AuthGenerator();
generator.setTargetDir(projectRoot + "wings/warlock-autogen/src/main/java/");
generator.setTargetDir(projectRoot + "wings/warlock/src/main/java-gen/");
generator.setTargetPkg("pro.fessional.wings.warlock.security.autogen");
generator.genPerm(helper);
generator.genRole(helper);
}
Expand All @@ -124,7 +126,8 @@ void autogen20WarlockAutogenAuth() {
@Disabled("call by autogen01AllMainJooq")
void autogen21WarlockAutogenJooq() {
Warlock3JooqGenerator generator = new Warlock3JooqGenerator();
generator.setTargetDir(projectRoot + "wings/warlock-autogen/src/main/java/");
generator.setTargetDir(projectRoot + "wings/warlock/src/main/java-gen/");
generator.setTargetPkg("pro.fessional.wings.warlock.database.autogen");
generator.gen(jdbcUrl, jdbcUser, jdbcPass,
Warlock3JooqGenerator.includeWarlockBase(false),
Warlock3JooqGenerator.includeWarlockBond(true),
Expand All @@ -135,7 +138,7 @@ void autogen21WarlockAutogenJooq() {
@Disabled("call by autogen01AllMainJooq")
void autogen31TinyMailAutogenJooq() {
ProjectJooqGenerator generator = new ProjectJooqGenerator();
generator.setTargetDir(projectRoot + "radiant/tiny-autogen/src/main/java/");
generator.setTargetDir(projectRoot + "radiant/tiny-mail/src/main/java-gen/");
generator.setTargetPkg("pro.fessional.wings.tiny.mail.database.autogen");
generator.gen(jdbcUrl, jdbcUser, jdbcPass,
bd -> bd.databaseIncludes("win_mail_sender"),
Expand All @@ -146,7 +149,7 @@ void autogen31TinyMailAutogenJooq() {
@Disabled("call by autogen01AllMainJooq")
void autogen31TinyTaskAutogenJooq() {
ProjectJooqGenerator generator = new ProjectJooqGenerator();
generator.setTargetDir(projectRoot + "radiant/tiny-autogen/src/main/java/");
generator.setTargetDir(projectRoot + "radiant/tiny-task/src/main/java-gen/");
generator.setTargetPkg("pro.fessional.wings.tiny.task.database.autogen");
generator.gen(jdbcUrl, jdbcUser, jdbcPass,
bd -> bd.databaseIncludes("win_task_define", "win_task_result"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import static pro.fessional.wings.faceless.flywave.WingsRevision.V04_20_1024_01_UserLogin;
import static pro.fessional.wings.faceless.flywave.WingsRevision.V04_20_1024_02_RolePermit;
import static pro.fessional.wings.faceless.flywave.WingsRevision.V05_20_1025_01_ConfRuntime;
import static pro.fessional.wings.faceless.flywave.WingsRevision.V06_20_1026_01_TinyTask;
import static pro.fessional.wings.faceless.flywave.WingsRevision.V07_20_1027_01_TinyMail;


/**
Expand All @@ -31,7 +33,9 @@ void resetSchemaWings() {
V03_20_1023_01_AuthEnum,
V04_20_1024_01_UserLogin,
V04_20_1024_02_RolePermit,
V05_20_1025_01_ConfRuntime
V05_20_1025_01_ConfRuntime,
V06_20_1026_01_TinyTask,
V07_20_1027_01_TinyMail
);
}
}
16 changes: 4 additions & 12 deletions radiant/devs-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
<groupId>pro.fessional.wings</groupId>
<artifactId>faceless</artifactId>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>faceless-awesome</artifactId>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>faceless-flywave</artifactId>
Expand Down Expand Up @@ -77,10 +73,6 @@
<groupId>pro.fessional.wings</groupId>
<artifactId>warlock</artifactId>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>warlock-awesome</artifactId>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>warlock-bond</artifactId>
Expand Down Expand Up @@ -121,9 +113,8 @@
<directory>${wings.rootdir}/wings/silencer-jaxb/src/main/java</directory>
<directory>${wings.rootdir}/wings/silencer-jaxb/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/wings/faceless/src/main/java</directory>
<directory>${wings.rootdir}/wings/faceless/src/main/java-gen</directory>
<directory>${wings.rootdir}/wings/faceless/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/wings/faceless-awesome/src/main/java</directory>
<directory>${wings.rootdir}/wings/faceless-awesome/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/wings/faceless-flywave/src/main/java</directory>
<directory>${wings.rootdir}/wings/faceless-flywave/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/wings/faceless-flywave/src/main/kotlin</directory>
Expand All @@ -142,16 +133,17 @@
<directory>${wings.rootdir}/wings/slardar-webmvc/src/main/java</directory>
<directory>${wings.rootdir}/wings/slardar-webmvc/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/wings/warlock/src/main/java</directory>
<directory>${wings.rootdir}/wings/warlock/src/main/java-gen</directory>
<directory>${wings.rootdir}/wings/warlock/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/wings/warlock-awesome/src/main/java</directory>
<directory>${wings.rootdir}/wings/warlock-awesome/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/wings/warlock-bond/src/main/java</directory>
<directory>${wings.rootdir}/wings/warlock-bond/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/wings/warlock-shadow/src/main/java</directory>
<directory>${wings.rootdir}/wings/warlock-shadow/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/radiant/tiny-mail/src/main/java</directory>
<directory>${wings.rootdir}/radiant/tiny-mail/src/main/java-gen</directory>
<directory>${wings.rootdir}/radiant/tiny-mail/target/generated-sources/annotations</directory>
<directory>${wings.rootdir}/radiant/tiny-task/src/main/java</directory>
<directory>${wings.rootdir}/radiant/tiny-task/src/main/java-gen</directory>
<directory>${wings.rootdir}/radiant/tiny-task/target/generated-sources/annotations</directory>
</sourceDirectories>
</configuration>
Expand Down
1 change: 0 additions & 1 deletion radiant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<description>Radiant components under GhostShip Model</description>

<modules>
<module>tiny-autogen</module>
<module>tiny-mail</module>
<module>tiny-task</module>
</modules>
Expand Down
Loading

0 comments on commit f1d8e03

Please sign in to comment.