Skip to content

Commit

Permalink
chore: update build files for gradle 7 and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
mchitre committed Oct 15, 2021
1 parent 87cebfe commit bed1812
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Building:

* `gradle` to build the jars
* `gradle test` to run all regression tests (automated through Github actions CI)
* `gradle upload` to upload jars to Maven staging (requires credentials)
* `gradle publish` to upload jars to Maven staging (requires credentials)
* `make html` to build developer's documentation (automated through ReadTheDocs)
* `gradle javadoc` to build the Java API documentation
* `npm run docs` to build the Javascript API documentation
Expand Down
137 changes: 67 additions & 70 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'signing'
plugins {
id 'java-library'
id 'groovy'
id 'maven-publish'
id 'signing'
}

defaultTasks 'jars'

Expand All @@ -22,7 +24,9 @@ try {
def npmproc = "npm -v".execute()
npmproc.waitForOrKill(3000)
npmExists = npmproc.exitValue() == 0
}catch (IOException ex){}
} catch (IOException ex){}

boolean isCI = System.getenv('CI') != null

targetCompatibility = 1.8
sourceCompatibility = 1.8
Expand All @@ -32,19 +36,19 @@ repositories {
}

dependencies {
compile 'org.codehaus.groovy:groovy:2.5.9'
compile 'org.jline:jline:3.12.1'
compile 'org.apache.commons:commons-lang3:3.9'
compile 'commons-io:commons-io:2.6'
compile 'uk.com.robust-it:cloning:1.9.12'
compile 'org.eclipse.jetty:jetty-server:9.4.26.v20200117'
compile 'org.eclipse.jetty:jetty-servlet:9.4.26.v20200117'
compile 'org.eclipse.jetty:jetty-rewrite:9.4.26.v20200117'
compile 'org.eclipse.jetty.websocket:websocket-server:9.4.26.v20200117'
compile 'com.google.code.gson:gson:2.8.5'
compile 'com.fazecast:jSerialComm:2.5.1'
testCompile 'junit:junit:4.12'
testCompile 'net.jodah:concurrentunit:0.4.6'
api 'org.codehaus.groovy:groovy:2.5.9'
api 'org.jline:jline:3.12.1'
api 'org.apache.commons:commons-lang3:3.9'
api 'commons-io:commons-io:2.6'
api 'uk.com.robust-it:cloning:1.9.12'
api 'org.eclipse.jetty:jetty-server:9.4.26.v20200117'
api 'org.eclipse.jetty:jetty-servlet:9.4.26.v20200117'
api 'org.eclipse.jetty:jetty-rewrite:9.4.26.v20200117'
api 'org.eclipse.jetty.websocket:websocket-server:9.4.26.v20200117'
api 'com.google.code.gson:gson:2.8.5'
api 'com.fazecast:jSerialComm:2.5.1'
testImplementation 'junit:junit:4.12'
testImplementation 'net.jodah:concurrentunit:0.4.6'
}

compileJava {
Expand Down Expand Up @@ -99,20 +103,20 @@ javadoc.doLast {
}
}

task buildjs {
task buildjs {
doLast {
if(npmExists){
if (npmExists) {
exec {
workingDir 'gateways/js'
commandLine 'npm', 'ci'
commandLine 'npm', isCI ? 'ci' : "install"
errorOutput = new ByteArrayOutputStream()
standardOutput = new ByteArrayOutputStream()
}
exec {
workingDir 'gateways/js'
commandLine 'npm', 'run', 'build'
}
}else{
} else{
project.logger.lifecycle('npm not found. Using cached fjage.js build')
}
}
Expand All @@ -133,7 +137,7 @@ task updatexterm {
commandLine 'npm', 'install', 'xterm@4.13.0', 'xterm-addon-attach@0.6.0', 'xterm-addon-fit@0.5.0', 'xterm-addon-web-links@0.4.0'
}
copy {
from (['node_modules/xterm-addon-web-links/lib', 'node_modules/xterm-addon-attach/lib', 'node_modules/xterm-addon-fit/lib', 'node_modules/xterm/lib']) {
from (['node_modules/xterm-addon-web-links/lib', 'node_modules/xterm-addon-attach/lib', 'node_modules/xterm-addon-fit/lib', 'node_modules/xterm/lib']) {
include '*.js'
}
from ('node_modules/xterm/css'){
Expand All @@ -147,64 +151,57 @@ task updatexterm {

////// tasks for MavenCentral deployment

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

signing {
sign configurations.archives
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
java {
withJavadocJar()
withSourcesJar()
}

publishing {
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
pom.project {
name archivesBaseName
packaging 'jar'
description 'Framework for Java and Groovy Agents'
url 'http://github.com/org-arl/fjage'
scm {
url 'http://github.com/org-arl/fjage'
connection 'scm:git:git://github.com/org-arl/fjage.git'
developerConnection 'scm:git:git@github.com:org-arl/fjage.git'
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = 'fjage'
pom {
name = 'fjage'
packaging = 'jar'
description = 'Framework for Java and Groovy Agents'
url = 'http://github.com/org-arl/fjage'
licenses {
license {
name '3-clause BSD License'
url 'http://github.com/org-arl/fjage/blob/master/LICENSE.txt'
distribution 'repo'
name = '3-clause BSD License'
url = 'http://github.com/org-arl/fjage/blob/master/LICENSE.txt'
distribution = 'repo'
}
}
developers {
developer {
id 'mchitre'
name 'Mandar Chitre'
id = 'mchitre'
name = 'Mandar Chitre'
}
}
scm {
connection = 'scm:git:git://github.com/org-arl/fjage.git'
developerConnection = 'scm:git:git@github.com:org-arl/fjage.git'
url = 'http://github.com/org-arl/fjage'
}
}
}
}
}

signing {
sign publishing.publications.mavenJava
}
2 changes: 1 addition & 1 deletion gateways/js/dist/esm/fjage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* fjage.js v1.9.1-rc5 */
/* fjage.js v1.10.0 */

/* global window self */

Expand Down
2 changes: 1 addition & 1 deletion gateways/js/dist/fjage.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions gateways/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gateways/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fjage",
"version": "1.9.1-rc5",
"version": "1.10.0",
"description": "JS Gateway for fjåge",
"main": "./dist/cjs/fjage.cjs",
"exports": {
Expand Down

0 comments on commit bed1812

Please sign in to comment.