Skip to content

Commit

Permalink
Merge pull request #240 from wl-net/fix-the-build-0
Browse files Browse the repository at this point in the history
Fix GitHub Actions build, update gradle
  • Loading branch information
AndrewX192 authored Nov 27, 2023
2 parents a2293ef + f52b195 commit c7e9e25
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 38 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
distribution: 'corretto'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: run tests
run: ./gradlew test
run: ./gradlew test --no-daemon
4 changes: 2 additions & 2 deletions common/arcus-drivers/groovy-bindings/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ task generateIpcdSource(type: JavaExec) {

def outputDir = file(generatedSrcDir)
outputs.dir outputDir

main 'com.iris.protocol.ipcd.definition.generator.ModelGenerator'

doFirst {
outputDir.mkdirs()
println "Generating templates from $templateName..."
classpath configurations.generator.asPath.split(':')
args '-t', templateName, '-i', ipcdDefinitionFile, '-o', genSrcMain
main 'com.iris.protocol.ipcd.definition.generator.ModelGenerator'
}
}

Expand Down
4 changes: 2 additions & 2 deletions common/arcus-model/platform-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ task generateSource(type: JavaExec) {

def outputDir = file(generatedSrcDir)
outputs.dir outputDir

main 'com.iris.capability.generator.java.Generator'

doFirst {
delete(outputDir)
outputDir.mkdirs()
println "Generating templates from $templateName..."
classpath configurations.generator.asPath.split(':')
args '-t', templateName, '-i', capabilityDir, '-o', generatedSrcDir
main 'com.iris.capability.generator.java.Generator'
}
}

Expand Down
4 changes: 2 additions & 2 deletions common/arcus-model/platform-messages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ task generateSource(type: JavaExec) {

def outputDir = file(generatedSrcDir)
outputs.dir outputDir

main 'com.iris.capability.generator.java.Generator'

doFirst {
delete(outputDir)
outputDir.mkdirs()
println "Generating templates from $templateName..."
classpath configurations.generator.asPath.split(':')
args '-t', templateName, '-i', capabilityDir, internalCapabilityDir, '-o', generatedSrcDir
main 'com.iris.capability.generator.java.Generator'
}
}

Expand Down
12 changes: 6 additions & 6 deletions common/arcus-protocol/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ task generateSource(type: JavaExec) {

def outputDir = file(generatedSrcDir)
outputs.dir outputDir

main 'com.iris.capability.generator.java.Generator'

doFirst {
delete(outputDir)
outputDir.mkdirs()
Expand All @@ -196,7 +197,6 @@ task generateSource(type: JavaExec) {
println "Generating templates from $templateName..."
classpath configurations.generator.asPath.split(':')
args '-t', templateName, '-i', capabilityDir, '-o', generatedSrcDir
main 'com.iris.capability.generator.java.Generator'
}
}

Expand All @@ -206,12 +206,12 @@ task generateProtocolSource(type: JavaExec) {

def outputDir = file(generatedSrcDir)
outputs.dir outputDir

main 'com.iris.protocol.ipcd.definition.generator.ModelGenerator'

doFirst {
println "Generating templates from $ipcdTemplateName..."
classpath configurations.generator.asPath.split(':')
args '-t', ipcdTemplateName, '-i', ipcdDefinitionFile, '-o', generatedSrcDir
main 'com.iris.protocol.ipcd.definition.generator.ModelGenerator'
}
}

Expand All @@ -221,12 +221,12 @@ task generateAosAdapterSource(type: JavaExec) {

def outputDir = file(generatedSrcDir)
outputs.dir outputDir

main 'com.iris.protocol.ipcd.definition.generator.AosGenerator'

doFirst {
println "Generating templates from $ipcdTemplateName..."
classpath configurations.generator.asPath.split(':')
args '-t', aosTemplateName, '-i', aosDefinitionFile, '-o', generatedSrcDir
main 'com.iris.protocol.ipcd.definition.generator.AosGenerator'
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/buildscript.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repositories {
repositories {
maven {
url 'http://dl.bintray.com/content/netflixoss/external-gradle-plugins/'
url 'https://dl.bintray.com/content/netflixoss/external-gradle-plugins/'
}

maven {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
25 changes: 7 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

Expand All @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -61,28 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
import com.iris.messages.type.Population;
import com.iris.prodcat.ProductCatalogReloadListener;
import com.iris.resource.config.ResourceModule;
import com.iris.test.IrisTestCase;
import com.iris.test.IrisMockTestCase;
import com.iris.test.Modules;
import com.iris.test.util.TestUtils;

@Modules({ InMemoryMessageModule.class, AttributeMapTransformModule.class, ResourceModule.class, ProductCatalogServiceModule.class })
public class TestProductCatalogService extends IrisTestCase {
public class TestProductCatalogService extends IrisMockTestCase {
@Inject
private ProductCatalogService service;

Expand Down
14 changes: 14 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@
* limitations under the License.
*/

plugins {
id("com.gradle.enterprise") version("3.15")
}

gradleEnterprise {
if (System.getenv("CI") != null) {
buildScan {
publishAlways()
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}
}

include 'common:arcus-client'
include 'common:arcus-common'
include 'common:arcus-metrics'
Expand Down

0 comments on commit c7e9e25

Please sign in to comment.