Add publishing to build script

This commit is contained in:
2025-09-04 15:49:18 +02:00
parent 14ec70c495
commit 49b31b74ba
4 changed files with 52 additions and 4 deletions

View File

@@ -1,9 +1,10 @@
plugins {
id("com.gradleup.shadow") version "8.3.8"
id("com.netflix.nebula.rpm") version "11.11.2"
id("maven-publish")
}
import org.redline_rpm.header.Flags
allprojects {
version = '2.0.0'
group = 'ch.psi'
@@ -13,7 +14,11 @@ allprojects {
ext.deploy_type= 'java'
ext.readonly = true
ext.plugin = ''
ext.rpm_requires = []
//Not forcing workbench to same version, as it can break other apps.
//If specific minimal version is needed then must be specified in project.
ext.workbench_version= '2.0.0'
repositories {
mavenLocal()
mavenCentral()
@@ -42,7 +47,6 @@ allprojects {
subprojects {
plugins.apply('java')
plugins.apply('java-library')
plugins.apply('com.gradleup.shadow')
plugins.apply('com.netflix.nebula.rpm')
plugins.apply('maven-publish')
@@ -102,6 +106,8 @@ subprojects {
def file_mode = readonly ? 0644: 0777
//def dir_mode = readonly ? 0755: 0777
def app_args_var = "APP_${app_name.replace('-', '_').toUpperCase()}_ARGS"
def proj_requires = project.rpm_requires
def workbench_version = project.workbench_version
project.tasks.register("rpm", Rpm) {
doFirst {
@@ -111,7 +117,11 @@ subprojects {
rpmFile.delete()
}
}
requires 'pshell-workbench'
//requires 'pshell-workbench'
requires("pshell-workbench", workbench_version, Flags.GREATER | Flags.EQUAL)
proj_requires.each { dep ->
requires dep
}
dependsOn 'jar'
release = app_release
@@ -187,6 +197,38 @@ subprojects {
link(sys_bin + bin_file_name, app_path + '/bin/' + bin_file_name)
link(sys_bin + app_name, sys_bin + bin_file_name)
}
project.afterEvaluate {
project.publishing {
publications {
MyPublication(MavenPublication) {
from project.components.java
if (project.tasks.findByName('sourcesJar')) {
//artifact project.tasks.sourcesJar
}
if (project.tasks.findByName('javadocJar')) {
//artifact project.tasks.javadocJar
}
if (project.tasks.findByName('rpm')) {
artifact project.tasks.rpm
}
groupId = project.group
artifactId = project.name
version = project.version
}
}
repositories {
maven {
credentials {
username artifactoryUser
password artifactoryPwd
}
url = artifactoryUrlRel
}
}
}
}
}
}

View File

@@ -1,3 +1,5 @@
action.custom-1=rpm
action.custom-1.args=--configure-on-demand -w -x check -x test rpm
action.custom-2=publish
action.custom-2.args=--configure-on-demand -w -x check -x test publish
action.debug.args=debug --args="-b -d -l -k -g -q -statusbar -size=1000x700 -console_log=SEVERE -m ./src/main/pkg -laf=dark -pipeline_server localhost:8889 -camera_server localhost:8888 -epics_config ch.psi.jcae.ContextFactory.addressList=localhost:54321"

View File

@@ -1,3 +1,5 @@
netbeans.hint.jdkPlatform=JDK_21
action.custom-1=rpm
action.custom-1.args=--configure-on-demand -w -x check -x test rpm
action.custom-2=publish
action.custom-2.args=--configure-on-demand -w -x check -x test publish

View File

@@ -1 +1,3 @@
action.custom-1=publish
action.custom-1.args=--configure-on-demand -w -x check -x test publish
action.debug.args=debug --args="-b -d -l -k -n -q -console_log=SEVERE -buffer_size=10 -size=1000x800 -p ScreenPanelSF -laf=dark -pipeline_server localhost:8889 -camera_server localhost:8888"