Project

Profile

Help

Revision 52584944

Added by Norman Tovey-Walsh 6 months ago

Build script tweaks for mirror repositories

View differences:

build.gradle
800 800
  commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
801 801
  standardOutput = recordBranch
802 802
  doLast {
803
    def output = new FileWriter(new File("build/built-branch"))
803
    def output = new FileWriter(new File("${buildDir}/built-branch"))
804 804
    output.write(recordBranch.toString("utf-8"))
805 805
    output.close()
806 806
  }
807
  doFirst {
808
    mkdir(buildDir)
809
  }
807 810
}
808 811

  
809 812
task hejCompile(
......
1365 1368
  }
1366 1369
}
1367 1370

  
1368
task javaReleases(
1369
  dependsOn: ["hejRelease", "pejRelease", "eejRelease"],
1370
  description: "Build all of the Java releases"
1371
) {
1372
  // Just a container to hang dependencies on
1373
}
1374

  
1375
// ============================================================
1376

  
1377
task dockerCoreContainer(
1378
  type: Exec,
1379
  description: "Build the CentOS 8 core container"
1380
) {
1381
  inputs.files("${projectDir}/src/docker/centos8-core")
1382
  commandLine "docker", "build",
1383
    "-t", "${dockerCentos8Core}",
1384
    "${projectDir}/src/docker/centos8-core"
1385
}
1386

  
1387
// In order to build this container, you must specify the location
1388
// of the JDK and the Jet software archive. Use
1389
// -PdockerJdk= to specify the location of the JDK RPM. Use
1390
// -PdockerJet= to specify the location of the Jet archive.
1391
task dockerBuilderContainer(
1392
  type: Exec,
1393
  dependsOn: ["docker_setupBuilder", "dockerCoreContainer"],
1394
  description: "Build the Saxonica builder container"
1395
) {
1396
  inputs.files("${buildDir}/docker/builder")
1397
  commandLine "docker", "build",
1398
    "-t", "${dockerBuildContainer}",
1399
    "${buildDir}/docker/builder"
1400
}
1401

  
1402
task docker_setupBuilder(
1403
  type: Copy,
1404
  dependsOn: ["docker_setupJdk", "docker_setupJet"],
1405
  description: "Setup to build the builder container"
1406
) {
1407
  from "src/docker/builder"
1408
  into "${buildDir}/docker/builder"
1409
}
1410

  
1411
task docker_testJdk(
1412
  description: "Test that the dockerJdk property has been specified"
1413
) {
1414
  doLast {
1415
    if (dockerJdk == "none") {
1416
      throw new GradleException("You must specify the JDK with -PdockerJdk=...")
1417
    }
1371
if (file("${projectDir}/src/main/java/com").exists()) {
1372
  task javaReleases(
1373
    dependsOn: ["hejRelease", "pejRelease", "eejRelease"],
1374
    description: "Build all of the Java releases"
1375
  ) {
1376
    // Just a container to hang dependencies on
1418 1377
  }
1419
}
1420

  
1421
task docker_setupJdk(
1422
  type: Copy,
1423
  dependsOn: ["docker_testJdk"],
1424
  description: "Setup the JDK for the builder container"
1425
) {
1426
  from dockerJdk
1427
  into "${buildDir}/docker/builder"
1428
}
1429

  
1430
task docker_testJet(
1431
  description: "Test that the dockerJet property has been specified"
1432
) {
1433
  doLast {
1434
    if (dockerJet == "none") {
1435
      throw new GradleException("You must specify Jet archive with -PdockerJet=...")
1436
    }
1378
} else {
1379
  // Ignore the EEJ and PEJ releases if the sources aren't available
1380
  task javaReleases(
1381
    dependsOn: ["hejRelease"],
1382
    description: "Build all of the Java releases"
1383
  ) {
1384
    // Just a container to hang dependencies on
1437 1385
  }
1438 1386
}
1439 1387

  
1440
task docker_setupJet(
1441
  type: Copy,
1442
  dependsOn: ["docker_testJet"],
1443
  description: "Setup the Jet archive for the builder container"
1444
) {
1445
  from dockerJet
1446
  into "${buildDir}/docker/builder"
1447
}
1448

  
1449 1388
// ============================================================
1450 1389

  
1451 1390
compileTestDrivers.dependsOn "${saxonEdition}j_compileTestDrivers"

Also available in: Unified diff