diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf757bc..0d028d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,8 +51,11 @@ jobs: - name: Build with Gradle uses: gradle/actions/setup-gradle@v3 env: - GITHUB_DEPLOY_USER: ${{ secrets.DEPLOY_USER }} - GITHUB_DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.DEPLOY_USER }} + ORG_GRADLE_PROJECT_deployToken: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deplyRepository: ${{ secrets.DEPLOY_REPOSITORY }} + GITHUB_DEPLOY_USER: ${{ github.actor }} + GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }} with: gradle-version: 8.0.2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 57b8aa4..dc5e610 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,16 +28,6 @@ jobs: java-version: 11 architecture: x64 - - name: Build with Gradle - uses: gradle/actions/setup-gradle@v3 - with: - gradle-version: 8.0.2 - arguments: createRelease - env: - GITHUB_DEPLOY_USER: ${{ secrets.DEPLOY_USER }} - GITHUB_DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} - GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }} - - name: Set Main Version run: echo "MAIN_VERSION=${{ github.event.release.name }}" >> src/main/java/org/spin/base/version.properties @@ -47,6 +37,19 @@ jobs: - name: Set Implementation Version run: echo "IMPLEMENTATION_VERSION=${{ github.event.release.tag_name }}" >> src/main/java/org/spin/base/version.properties + - name: Build with Gradle + uses: gradle/gradle-build-action@v3 + with: + gradle-version: 8.0.2 + arguments: createRelease + env: + ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.DEPLOY_USER }} + ORG_GRADLE_PROJECT_deployToken: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deplyRepository: ${{ secrets.DEPLOY_REPOSITORY }} + GITHUB_DEPLOY_USER: ${{ github.actor }} + GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }} + - name: Upload descriptor file artifact uses: actions/upload-artifact@v4 with: diff --git a/.gitignore b/.gitignore index a9e8fe5..f113d09 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,9 @@ hs_err_pid* /bin/ /.gradle/ +/libs/ +/dependences/ /build/ -*.properties \ No newline at end of file +*.properties +# skip folder dependencies +!dependencies/*.jar diff --git a/build.gradle b/build.gradle index 8773b46..09676d5 100644 --- a/build.gradle +++ b/build.gradle @@ -84,16 +84,17 @@ protobuf { } sourceSets { - main { - java { - srcDirs 'build/generated/source/proto/main/grpc' - srcDirs 'build/generated/source/proto/main/java' - srcDirs 'src/main/proto' - } + main { + java { + srcDirs 'build/generated/source/proto/main/grpc' + srcDirs 'build/generated/source/proto/main/java' + srcDirs 'src/main/proto' + } resources { + srcDirs 'src/main/java' include 'org/spin/base/version.properties' } - } + } } // Copy proto descriptor another folder @@ -111,16 +112,16 @@ allprojects { } } -task AdempiereTemplateServer(type: CreateStartScripts) { +task AdempiereReportEngineServer(type: CreateStartScripts) { mainClass = javaMainClass - applicationName = 'adempiere-report-engine-service-server' - outputDir = new File(project.buildDir, 'tmp') - classpath = jar.outputs.files + project.configurations.runtimeClasspath + applicationName = 'adempiere-report-engine-service-server' + outputDir = new File(project.buildDir, 'tmp') + classpath = jar.outputs.files + project.configurations.runtimeClasspath } applicationDistribution.into('bin') { - from(AdempiereTemplateServer) - fileMode = 0755 + from(AdempiereReportEngineServer) + fileMode = 0755 } // Create release for project diff --git a/src/main/java/org/spin/base/Version.java b/src/main/java/org/spin/base/Version.java index 8aafde0..6b65146 100644 --- a/src/main/java/org/spin/base/Version.java +++ b/src/main/java/org/spin/base/Version.java @@ -21,6 +21,8 @@ import java.text.SimpleDateFormat; import java.util.Properties; +import org.compiere.util.CLogger; + /** * @author Edwin Betancourt, EdwinBetanc0urt@outlook.com, https://github.com/EdwinBetanc0urt * Service for backend of Version @@ -28,6 +30,8 @@ public final class Version { + private static CLogger log = CLogger.getCLogger(Version.class); + /** Main Version String */ // Conventions for naming second number is even for stable, and odd for unstable // the releases will have a suffix (a) for alpha - (b) for beta - (t) for trunk - (s) for stable - and (LTS) for long term support @@ -60,7 +64,8 @@ public final class Version IMPLEMENTATION_VERSION = properties.getProperty("IMPLEMENTATION_VERSION"); } } catch (IOException e) { - // file does not exist + // file does not exists + log.warning("File version.properties does no exists"); } } } diff --git a/src/main/java/org/spin/report_engine/server/ReportEngineServer.java b/src/main/java/org/spin/report_engine/server/ReportEngineServer.java index 5e823c2..931ba99 100644 --- a/src/main/java/org/spin/report_engine/server/ReportEngineServer.java +++ b/src/main/java/org/spin/report_engine/server/ReportEngineServer.java @@ -44,6 +44,7 @@ public class ReportEngineServer { /** Services/Methods allow request without Bearer token validation */ private List ALLOW_REQUESTS_WITHOUT_TOKEN = Arrays.asList( // proto package . proto service / proto method + "report_engine.ReportEngine/GetSystemInfo" ); /** Revoke session */