Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build and Publish Release Version

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: liberica

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper

- name: Checkout repository
uses: actions/checkout@v4

- name: Build project and run tests
run: ./gradlew clean build

- name: Store test results
if: always()
uses: actions/upload-artifact@v4
with:
name: reports
path: |
**/build/reports/
**/build/test-results/

- name: Upload archives
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: |
./gradlew publish \
-Psigning.keyId=$SIGNING_KEY_ID \
-Psigning.secretKey=$SIGNING_SECRET_KEY \
-Psigning.password=$SIGNING_PASSWORD \
-PossrhUsername=$OSSRH_USERNAME \
-PossrhPassword=$OSSRH_PASSWORD

- name: Read version of the project
id: read_project_version
run: |
VERSION=$(./gradlew properties | grep -w "version" | cut -d ':' -f 2 | xargs)
echo "Version found: ${VERSION}"
echo "project_version=${VERSION}" >> $GITHUB_OUTPUT

- name: Create Tag
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ steps.read_project_version.outputs.project_version }}",
sha: context.sha
})

- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.read_project_version.outputs.project_version }}"
release_name: "Release v${{ steps.read_project_version.outputs.project_version }}"
body: "Release of version ${{ steps.read_project_version.outputs.project_version }}"
draft: false
prerelease: false
121 changes: 69 additions & 52 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
* Copyright 2009-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,10 @@
* limitations under the License.
******************************************************************************/

plugins {
id 'jacoco'
}

allprojects {
ext {
sharedDir = file("${project.rootDir}/shared")
Expand All @@ -22,8 +26,8 @@ allprojects {
genDir = file("${srcDir}/gen")
genJavaDir = file("${genDir}/java")

incremental_build = project.hasProperty('i') ? true : false
sonatype_publish = project.hasProperty('sonatypePublish') ? true : false
incremental_build = project.hasProperty('i')
sonatype_publish = project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')

// Set defaults
if (!project.hasProperty("revision")) {
Expand All @@ -37,37 +41,31 @@ allprojects {
}
//Lib versions
version_slf4j = '1.7.5'

exactproVersion = '12'
}
}

version = "${quickfixjPrefixVersion}.${exactproVersion}"

subprojects {
apply plugin: 'eclipse'
apply plugin: 'jacoco'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'

if (sonatype_publish) {
apply plugin: 'signing'
}

group = 'com.exactpro.quickfixj'
version = "1.6.0.${exactproVersion}"

sourceCompatibility = 1.7 //Java version compatibility to use when compiling Java source.
targetCompatibility = 1.7 //Java version to generate classes for.
sourceCompatibility = JavaVersion.VERSION_1_7 //Java version compatibility to use when compiling Java source.
targetCompatibility = JavaVersion.VERSION_1_7 //Java version to generate classes for.
compileJava.options.debugOptions.debugLevel = "source,lines,vars" // Include debug information

buildscript { // artifacrory plugin
repositories {
jcenter()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.2.+')
classpath(group: 'com.netflix.nebula', name: 'gradle-extra-configurations-plugin', version: '2.2.+')
}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
Expand All @@ -78,11 +76,11 @@ subprojects {
name 'MavenLocal' // for local builds only
url sharedDir
}
jcenter()
mavenCentral()
}

configurations {
compile.exclude module: 'avalon-framework-api'
implementation.exclude module: 'avalon-framework-api'

all {
transitive = true
Expand Down Expand Up @@ -127,66 +125,79 @@ subprojects {
}
}

uploadArchives {
repositories {
mavenDeployer {
if (sonatype_publish) {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'Exactpro QuickFixJ'
if (sonatype_publish) {
pom {
name = 'Exactpro QuickFixJ'
packaging 'jar'
// optionally artifactId can be defined here
description 'QuickFixJ is one of such libraries we depend on and which was modified by Exactpro.'
url 'https://github.com/Exactpro/quickfixj'
url = vcsUrl

scm {
connection 'scm:git:https://github.com/Exactpro/quickfixj'
developerConnection 'scm:git:https://github.com/Exactpro/quickfixj'
url 'https://github.com/Exactpro/quickfixj'
connection = 'scm:git:https://github.com/Exactpro/quickfixj'
developerConnection = 'scm:git:https://github.com/Exactpro/quickfixj'
url = vcsUrl
}

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id 'Nikita-Smirnov-Exactpro'
name 'Nikita Smirnov'
email 'nikita.smirnov@exactprosystems.com'
id = 'Nikita-Smirnov-Exactpro'
name = 'Nikita Smirnov'
email = 'nikita.smirnov@exactprosystems.com'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
id = 'Nikita-Smirnov-Exactpro'
name = 'Nikita Smirnov'
email = 'nikita.smirnov@exactprosystems.com'
id = 'sf_devs'
name = 'sf_devs'
email = 'sf_devs@exactpro.com'
                            id.set("developer")
                            name.set("developer")
                            email.set("developer@exactpro.com")

}
}
}
} else {
// uniqueVersion = false // publish non unique snapshots to local repository
repository(url: "file://${sharedDir}")
}
}
}
doFirst { sharedDir.mkdirs() }

repositories {
if (sonatype_publish) {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots"
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
} else {
// uniqueVersion = false // publish non unique snapshots to local repository
sharedDir.mkdirs()
maven {
url = "file://${sharedDir}"
}
}
}
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: classes) {
classifier = 'javadoc'
tasks.register('javadocJar', Jar) {
dependsOn classes
archiveClassifier = 'javadoc'
from javadoc
}

Expand All @@ -195,6 +206,12 @@ subprojects {
}

if (sonatype_publish) {
tasks.withType(Sign).configureEach {
onlyIf {
project.hasProperty('signing.keyId') && project.hasProperty('signing.password')
}
}

signing {
sign configurations.archives
}
Expand Down
11 changes: 8 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/******************************************************************************
#* Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
#* Copyright 2009-2024 Exactpro (Exactpro Systems Limited)
#*
#* Licensed under the Apache License, Version 2.0 (the "License");
#* you may not use this file except in compliance with the License.
Expand All @@ -14,5 +14,10 @@
#* limitations under the License.
#******************************************************************************/

org.gradle.daemon true
org.gradle.daemon.idletimeout 10000
org.gradle.daemon=true
org.gradle.daemon.idletimeout=10000

quickfixjPrefixVersion=1.6.0
exactproVersion=12

vcsUrl=https://github.com/Exactpro/quickfixj
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
6 changes: 2 additions & 4 deletions quickfixj-codegenerator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
* limitations under the License.
******************************************************************************/

apply plugin: 'artifactory'

archivesBaseName = 'quickfixj-code-generator'
archivesBaseName = 'quickfixj-code-generator'

test.enabled = false
compileTestJava.enabled = false
compileTestJava.enabled = false
29 changes: 13 additions & 16 deletions quickfixj-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
* limitations under the License.
******************************************************************************/

apply plugin: 'artifactory'
apply plugin: 'provided-base'

ext {
dictDir = file('src/main/dicts')
}
Expand All @@ -39,24 +36,24 @@ sourceSets {

dependencies {
if (incremental_build) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove incremental_build mode because we are going to use github work flow to publish all artifacts

compile 'com.exactpro.quickfixj:quickfixj-code-generator:1.6.0.1-SNAPSHOT'
implementation 'com.exactpro.quickfixj:quickfixj-code-generator:1.6.0.1-SNAPSHOT'
} else {
compile project(':quickfixj-codegenerator')
implementation project(':quickfixj-codegenerator')
}

compile 'com.exactpro.mina:apache-mina-core:2.0.9.1'
implementation 'com.exactpro.mina:apache-mina-core:2.0.9.1'

compile "org.slf4j:slf4j-api:${version_slf4j}"
implementation "org.slf4j:slf4j-api:${version_slf4j}"

compile 'com.cloudhopper.proxool:proxool:0.9.1'
implementation 'com.cloudhopper.proxool:proxool:0.9.1'

testCompile 'junit:junit:4.10'
testCompile 'org.mockito:mockito-all:1.10.19'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.hamcrest:hamcrest-all:1.1'
testCompile 'hsqldb:hsqldb:1.8.0.10'
testCompile 'tyrex:tyrex:1.0.1'
testCompile "org.slf4j:slf4j-jdk14:${version_slf4j}"
testImplementation 'junit:junit:4.10'
testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.hamcrest:hamcrest-all:1.1'
testImplementation 'hsqldb:hsqldb:1.8.0.10'
testImplementation 'tyrex:tyrex:1.0.1'
testImplementation "org.slf4j:slf4j-jdk14:${version_slf4j}"
}

task generateMessage {
Expand Down Expand Up @@ -94,5 +91,5 @@ test {
/*afterTest { desc, result ->
println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}. Time: ${(result.endTime - result.startTime)/1000}s"
}*/
testLogging.showStandardStreams = true
// testLogging.showStandardStreams = true
}