diff --git a/.github/workflows/server-app.yml b/.github/workflows/server-app.yml index 453f957..0d89695 100644 --- a/.github/workflows/server-app.yml +++ b/.github/workflows/server-app.yml @@ -20,6 +20,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + submodules: recursive - uses: actions/setup-java@v4 with: @@ -27,7 +29,7 @@ jobs: java-version: "17" - name: Build with Gradle - run: ./gradlew bootRun + run: ./gradlew build - name: Run tests if: ${{ github.event.inputs.run_tests }} diff --git a/server/.gitignore b/server/.gitignore index 1b6985c..b7a6803 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -1,5 +1,3 @@ -# Ignore Gradle project-specific cache directory .gradle - -# Ignore Gradle build output directory build +compiler_bin diff --git a/server/build.gradle.kts b/server/build.gradle.kts new file mode 100644 index 0000000..d82033c --- /dev/null +++ b/server/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("cpp-application") +} + + +// opensource COBOL 4J のビルドタスクを追加 +tasks.register("buildCompiler") { + group = "build" + description = "Build opensource COBOL 4J" + + //// 作業ディレクトリを指定 + workingDir = file("${project.projectDir}/opensourcecobol4j/") + + // 入力ファイルと出力ファイルを指定 + inputs.files(fileTree("${project.projectDir}/opensourcecobol4j")) + outputs.file("${project.projectDir}/compiler_bin/lib/opensourcecobol4j/libcobj.jar") + + // 実行コマンドを指定 + commandLine("sh", "-c", """ + mkdir -p ${project.projectDir}/compiler_bin && + ./configure --prefix=${project.projectDir}/compiler_bin && + make && + make install + """.trimIndent()) +} + +tasks.named("build").configure { + dependsOn("buildCompiler") +} \ No newline at end of file