Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OD-19152 Angel Dependencies upgrade #1326

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/selenuim-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: ankane/setup-mariadb@v1
with:
mariadb-version: "10.11"
database: angel_selenuim_test
database: angel_selenium_test

- uses: actions/checkout@v2

Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:

- name: Run tests
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
run: ./gradlew selenium-test:test -x client-html:test -PdbUrl=jdbc:mariadb://localhost:3306/angel_selenuim_test?user=root --stacktrace
run: ./gradlew selenium-test:test -x client-html:test -PdbUrl=jdbc:mariadb://localhost:3306/angel_selenium_test?user=root --stacktrace

- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v1
Expand Down
23 changes: 18 additions & 5 deletions api-doc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* Copyright ish group pty ltd 2020.
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License version 3 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*/

apply from: "$rootDir/nodeSetup.gradle"

task apiDoc(type: NpmTask, dependsOn: [':server-api:apiDocs_mergeSwagger', 'npmInstall']) {
Expand All @@ -9,22 +20,24 @@ task apiDoc(type: NpmTask, dependsOn: [':server-api:apiDocs_mergeSwagger', 'npmI
npmCommand = ['run']
args = ['build']

outputs.dir("${buildDir}/api-docs")
outputs.dir("${layout.buildDirectory.get()}/api-docs")
}

build.dependsOn(apiDoc)

task packageApiDoc (type: Zip, dependsOn: apiDoc) {
group = "documentation"
from apiDoc.outputs.files
archiveClassifier = 'documentation'
}

tasks.named('build') {
dependsOn apiDoc
}

publishing {
publications {
docs(MavenPublication) {
create("docs", MavenPublication) {
artifact(packageApiDoc) {
artifactId "apiDoc"
artifactId = "apiDoc"
}
}
}
Expand Down
20 changes: 14 additions & 6 deletions api-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import test.PrepareTestDatabase

/*
* Copyright ish group pty ltd 2020.
*
Expand All @@ -11,6 +9,17 @@ import test.PrepareTestDatabase
* See the GNU Affero General Public License for more details.
*/

import test.PrepareTestDatabase

plugins {
id 'java'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

ext {
karateVersion = '1.0.1'
}
Expand All @@ -29,9 +38,6 @@ dependencies {
testImplementation "org.eclipse.jetty:jetty-client:$jettyVersion"
}

sourceCompatibility = 11
targetCompatibility = 11

task copyConfig(type: Copy) {
from("$rootDir/api-test/src/test/resources/") {
include 'onCourse.yml'
Expand All @@ -52,7 +58,9 @@ test {
events "failed", "standardOut"
}

tasks.getByName('prepareTestDatabase').mustRunAfter(':server:startDaemon').mustRunAfter('copyConfig')
tasks.named('prepareTestDatabase').get()
.mustRunAfter(':server:startDaemon')
.mustRunAfter('copyConfig')

dependsOn "copyConfig"
dependsOn ":server:startDaemon"
Expand Down
40 changes: 17 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*/

buildscript {
ext {
log4j2Version = '2.17.2'
Expand All @@ -14,7 +15,7 @@ buildscript {
googleGuiceVersion = '4.2.2'
groovyVersion = '2.5.15'
bouncycastleVersion = '1.67'
bootiqueVersion = '1.2'
bootiqueVersion = '2.0'
cfxVersion = '3.3.5'
//latest jackson version 2.12.2 (no any conflicts with spring, see AbstractApplicationContext), same version jasper uses also
jacksonVersion = '2.12.2'
Expand All @@ -31,11 +32,11 @@ buildscript {
}

plugins {
id 'com.github.ben-manes.versions' version '0.39.0' // adds the task 'dependencyUpdates -Drevision=release'
id 'com.github.node-gradle.node' version '3.1.1' apply false
id 'com.github.psxpaul.execfork' version '0.1.15' apply false
id 'com.github.ben-manes.versions' version '0.51.0' // adds the task 'dependencyUpdates -Drevision=release'
id 'com.github.node-gradle.node' version '7.0.1' apply false
id 'com.github.psxpaul.execfork' version '0.2.2' apply false
id 'idea'
id 'org.barfuin.gradle.taskinfo' version '1.2.0' // adds the task 'tiTree [some task]' and the task 'tiOrder [some task]'
id 'org.barfuin.gradle.taskinfo' version '2.2.0' // adds the task 'tiTree [some task]' and the task 'tiOrder [some task]'

id 'java'
id 'groovy'
Expand Down Expand Up @@ -64,7 +65,11 @@ subprojects {
// added it exactly here since api dep doesn't work without that plugin
apply plugin: 'java-library'

sourceCompatibility = 11
java {
sourceCompatibility = JavaVersion.VERSION_11
}

group = 'ish.oncourse.angel'
// get the version from the command line properties
version = project.hasProperty('releaseVersion') && project.releaseVersion ? project.releaseVersion : "99-SNAPSHOT"
version = version.replace('v','') // remove the leading v from the version
Expand All @@ -90,22 +95,15 @@ subprojects {

implementation 'javax.annotation:javax.annotation-api:1.3.2'



testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.0'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.8.0' // needed for dbunit https://sourceforge.net/p/dbunit/feature-requests/222/
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.dbunit:dbunit:2.7.0'

testImplementation "org.codehaus.groovy:groovy-test-junit5:$groovyVersion"
testImplementation "org.codehaus.groovy:groovy-sql:$groovyVersion"
}
// uncomment when dbunit is detached from junit
// configurations {
// testImplementation.exclude group: 'junit' // exclude junit4
// }

group = 'ish.oncourse.angel'

publishing {
repositories {
Expand Down Expand Up @@ -133,15 +131,11 @@ subprojects {
'Trusted-Library': 'true'
}

ext {
testFailed = false
}

test {
boolean testFailed = false
useJUnitPlatform()

systemProperties 'java.awt.headless': 'true',
'java.locale.providers': 'COMPAT,SPI'
systemProperties 'java.awt.headless': 'true', 'java.locale.providers': 'COMPAT,SPI'
maxHeapSize = '3000M'
maxParallelForks = 1
ignoreFailures = true
Expand All @@ -152,7 +146,7 @@ subprojects {
}

reports {
junitXml.enabled = true
junitXml.required = true
}

afterSuite { desc, result ->
Expand All @@ -169,9 +163,9 @@ subprojects {
}

task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/tests")
destinationDirectory = file("${layout.buildDirectory.get()}/reports/tests")
// Include the results from the `test` task in all subprojects
reportOn subprojects*.test
testResults.from = subprojects*.test
}

// Skip beta and other non-final releases in the update report
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain ssh copy of the License at
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
Expand All @@ -18,6 +18,7 @@ package au.com.ish.docs
import groovyjarjarantlr.RecognitionException
import groovyjarjarantlr.TokenStreamException
import groovyjarjarantlr.collections.AST
import org.apache.groovy.antlr.override.GroovydocVisitor
import org.apache.commons.lang3.StringUtils
import org.codehaus.groovy.antlr.AntlrASTProcessor
import org.codehaus.groovy.antlr.SourceBuffer
Expand All @@ -29,13 +30,13 @@ import org.codehaus.groovy.antlr.java.JavaRecognizer
import org.codehaus.groovy.antlr.parser.GroovyLexer
import org.codehaus.groovy.antlr.parser.GroovyRecognizer
import org.codehaus.groovy.antlr.treewalker.PreOrderTraversal
import org.codehaus.groovy.antlr.treewalker.SourceCodeTraversal
import org.codehaus.groovy.antlr.treewalker.Visitor
import org.codehaus.groovy.ast.ModuleNode
import org.codehaus.groovy.control.*
import org.codehaus.groovy.groovydoc.GroovyClassDoc
import org.codehaus.groovy.groovydoc.GroovyRootDoc
import org.codehaus.groovy.runtime.ResourceGroovyMethods
import org.codehaus.groovy.tools.groovydoc.LinkArgument
import org.codehaus.groovy.tools.groovydoc.SimpleGroovyClassDocAssembler
import org.codehaus.groovy.tools.groovydoc.SimpleGroovyExecutableMemberDoc
import org.codehaus.groovy.tools.groovydoc.SimpleGroovyPackageDoc
import org.codehaus.groovy.tools.groovydoc.SimpleGroovyRootDoc
Expand Down Expand Up @@ -68,32 +69,56 @@ class DslGroovyRootDocBuilder {
JavaLexer lexer = new JavaLexer(unicodeReader)
unicodeReader.setLexer(lexer)
parser = JavaRecognizer.make(lexer)
parser.setSourceBuffer(sourceBuffer)
parser.compilationUnit()
} else {
GroovyLexer lexer = new GroovyLexer(unicodeReader)
unicodeReader.setLexer(lexer)
parser = GroovyRecognizer.make(lexer)
parser.setSourceBuffer(sourceBuffer)
parser.compilationUnit()
}

AST ast = parser.getAST()
if (isJava) {
// modify the Java AST into ssh Groovy AST (just token types)
Visitor java2groovyConverter = new Java2GroovyConverter(parser.getTokenNames())
AntlrASTProcessor java2groovyTraverser = new PreOrderTraversal(java2groovyConverter)
java2groovyTraverser.process(ast)

// now mutate (groovify) the ast into groovy
Visitor groovifier = new Groovifier(parser.getTokenNames(), false)
AntlrASTProcessor groovifierTraverser = new PreOrderTraversal(groovifier)
groovifierTraverser.process(ast)
if (isJava) {
parser.setSourceBuffer(sourceBuffer)
parser.compilationUnit()
AST ast = parser.getAST()

// modify the Java AST into a Groovy AST (just token types)
Visitor java2groovyConverter = new Java2GroovyConverter(parser.getTokenNames())
AntlrASTProcessor java2groovyTraverser = new PreOrderTraversal(java2groovyConverter)
java2groovyTraverser.process(ast)

// now mutate (groovify) the ast into groovy
Visitor groovifier = new Groovifier(parser.getTokenNames(), false)
AntlrASTProcessor groovifierTraverser = new PreOrderTraversal(groovifier)
groovifierTraverser.process(ast)
}

CompilerConfiguration config = new CompilerConfiguration()
config.getOptimizationOptions().put(CompilerConfiguration.GROOVYDOC, true)
CompilationUnit compUnit = new CompilationUnit(config)
SourceUnit unit = new SourceUnit(file, src, config, null, new ErrorCollector(config));
compUnit.addSource(unit);
int phase = Phases.CONVERSION;
if (properties.containsKey("phaseOverride")) {
String raw = properties.getProperty("phaseOverride")
try {
phase = Integer.parseInt(raw)
} catch(NumberFormatException ignore) {
raw = raw.toUpperCase();
switch(raw) {
// some dup here but kept simple since we may swap Phases to an enum
case "CONVERSION": phase = 3; break;
case "SEMANTIC_ANALYSIS": phase = 4; break;
case "CANONICALIZATION": phase = 5; break;
case "INSTRUCTION_SELECTION": phase = 6; break;
case "CLASS_GENERATION": phase = 7; break;
default:
System.err.println("Ignoring unrecognised or unsuitable phase and keeping default");
}
}
}
Visitor visitor = new SimpleGroovyClassDocAssembler(packagePath, file, sourceBuffer, links, properties, !isJava)
AntlrASTProcessor traverser = new SourceCodeTraversal(visitor)
traverser.process(ast)
return ((SimpleGroovyClassDocAssembler)visitor).getGroovyClassDocs()
compUnit.compile(phase);
ModuleNode root = unit.getAST()
GroovydocVisitor visitor = new GroovydocVisitor(unit, packagePath, links, properties)
root.getClasses().forEach(clazz -> visitor.visitClass(clazz))
return visitor.getGroovyClassDocs()
}

protected void setOverview() {
Expand Down
Loading
Loading