Skip to content

Commit

Permalink
Integrate next (#73)
Browse files Browse the repository at this point in the history
* Advance to version 0.2

* Remove explicit root project name.

* Add a prerelease identifier.

* Set linker to clang++.

* Update link.

* Discover target host (#42)

* Update to Gradle 8.4 final

* Advance version to 0.3

* Improve external cmake project sample.

* Discover host target.

Closes #34.

* Test host target discovery.

* Conventional archive adds a test application (#43)

* Update to Gradle 8.4 final

* Advance version to 0.3

* Improve external cmake project sample.

* Discover host target.

Closes #34.

* Test host target discovery.

* Conventional archive adds a test application.

* When configuring ixx includes, configure also commands task (#44)

* Update to Gradle 8.4 final

* Advance version to 0.3

* Improve external cmake project sample.

* Discover host target.

Closes #34.

* Test host target discovery.

* Conventional archive adds a test application.

* When configuring ixx includes, configure also the commands task.

* Test compile option inheritance.

* Expose locateTool (#47)

* Update CI; add LLVM 17. (#48)

* Get path from providers.

* Add a run task for conventional application components.

* Wire the main module to the test module.

* Don't apply cpp plugin

* Require JDK 17

* Shorten notation of test files.

* API for conventional archive and executable file names (#50)

* Don't apply cpp plugin

* Require JDK 17

* Shorten notation of test files.

* API for conventional archive and executable file names.

Closes #33.

* API to define includables etc. as public or private. (#51)

* API to define includables etc. as public or private.

Closes #46.

* API to define includables etc. as public or private.

Closes #46.

* Add MetalService::getHost and MetalService::getTarget.

* Remove getLinkables, use SourceTask::source.

* Wire run-test to test to check.

* API for set of enabled targets (#53)

Provide API for restricting the set of targets where the source set or component is enabled.

The empty set has the special meaning of permitting everything.

* Avoid linking empty source set. (#55)

Closes #52.

* Add javadoc.

* Update to 0.3-next

* Update samples.

* Ignore sample external src.

* Locate tools with metal extension.

* Update version string.

* Fix runTask onlyIf targets is empty i.e. default.

* Add onlyIf reason.

* Advance version to 0.3-rc-1

* Advance version to 0.4

* Define publish workflow

* Try  --validate-only first

* Fix workflow name

* Improve source sets (#59)

* Rewire source sets and tasks via intermediate file collections.

Add "compile", "import", "include" and "link" collections to consume the corresponding type. Rename the resolvable providers to "compilables", ""importables", "includables" and "linkables".

* Update nomenclature and remove obsolete properties.

* Remove MetalApplication.archive

* Enable configuration cache (#60)

* Version with SNAPSHOT instead of git hash.

* Enable configuration cache on tests.

* Make compile tasks cacheable.

* Make archive and link cacheable.

* Enable configuration cache on tests.

* Add MetalComponent.output

* Some documentation

* Test MetalComponent.output

* Make commands task cacheable

* Annotate cacheable tasks. (#63)

* Propagate build environment metal.path property into tests (#64)

* Propagate build environment metal.path property into tests

* Use findProperty to permit unset

* Remove debug statements and return to array access notation

* Component specific dependencies. (#68)

* Add per component dependency configurations.

* Add javadoc.

* Remove --validate-only (#70)

(cherry picked from commit aafd1cb)

* Advance version to 0.5

* Update Gradle to 8.5-rc-4

* Fix archive file name.

* Update application samples.

* Remove obsolete samples.

* Update README.

* Replace with clang generated source.

* Update archive samples.

* Update dependency samples.

* New design (#71)

* Start new design.

* Restore the prebuilt plugin.

* Set component name with target conventional suffix.

* Add language specific options to compiler arguments.

* Configure conventional header directory.

* Remove obsolete class.

* Restore conventional header sources.

* Add MetalIxxPrecompile.

* Remove obsolete imports.

* Make MakeIxxPrecompile extends MetalCompile.

* Update README.

* Configure application and library import dependencies.

* Remove obsolete sources.

* Test import dependencies.

* Update samples.

* Add library project test support.

* Update sample.

* Avoid running nonexistent executables.

* Move MetalExtension.

* Remove obsolete code.

* Add consumable configurations.

* Add MetalExtensionTest.

* Add copyright notice.

* Add MetalHostValueSource.

* Reusar um MetalHostValueSource.

* Move archiveFileName and executableFileName to class Metal.

* Update sample.

* Update Gradle to 8.5.

* Always build development samples with current code.

* Remover Gradle version from samples.

* Fix sample.

* Use DSL in sample.

* Remove --included-build from build command line.

* Always apply the base plugin in the root project.

* Restore component targets property.

* Remove target property.

* Remove obsolete properties.

* Set tasks onlyIf target is enabled.

* Restore target property: the target must be a part of the build cache key.

* Include the target`s outputs only.

* Add build target test.

* Use lld only if target != host.

* Adicionar Javadoc.

* Upgrade Gradle to 8.6

* Aplicar phoenix-actions/test-reporting@v8

* Apply Allure.

* Publish Allure report with actions/upload-artifact

* Generate report before uploading

* Upgrade gradle/wrapper-validation-action to v2

* Upgrade gradle/gradle-build-action to v3

* Fix step name

* Update LLVM 17 to 17.0.6

* Upgrade actions/checkout to v4

* Always run allureAggregateReport step

* Upgrade actions/setup-java to v3

* Publish Allure reports from ubuntu workflows

* Pass properties to tests via gradle.properties, not command line

* Copy gradle.properties iff exists

* Add display name to suites and tests

* Restore force-version: true

* Add last display name and remove unecessary public visibility

* Document required Gradle version.

* Add compile commands tasks to application and library projects.

* Add directory and append tool path into arguments.

* Add aggregateCommands task.

* Add commands dependencies.

* Move configuration registration to base plugin and compile task registration to language plugins.

* Represent a library test application with an actual test MetalApplication.

* Aggregate commands includes this project commands.

* Restore the prebuilt project plugin.

* Add commands dependencies.

* Apply the base plugin.

* Add DSL for component source filters (#72)

* Add tests for the desired DSL.

* Add desired notation without wiring to tasks.

* Wire component filters to task filters.

* Remove obsolete code.

* Remove obsolete code.

* Update version.

* Update version.
  • Loading branch information
pedrolamarao authored Feb 21, 2024
1 parent aafd1cb commit afc968d
Show file tree
Hide file tree
Showing 263 changed files with 5,543 additions and 6,652 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
timeout-minutes: 10
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: "Set up JDK 17"
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: "Publish with Gradle"
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
arguments: publishPlugins "-Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}" "-Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}"
36 changes: 29 additions & 7 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
timeout-minutes: 10
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: "Set up JDK 17"
uses: actions/setup-java@v3
with:
Expand All @@ -21,30 +21,52 @@ jobs:
ubuntu-version: 22.04
version: 16.0.4
- name: "Build with Gradle"
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
arguments: build
- name: "Generate Allure Report"
uses: gradle/gradle-build-action@v3
if: always()
with:
arguments: allureAggregateReport
- name: "Publish Allure Report"
uses: actions/upload-artifact@v4
if: always()
with:
name: ubuntu-22.04-llvm-16
path: "build/reports/allure-report/allureAggregateReport/index.html"
build-llvm-17:
name: "build with llvm 17"
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@v1
- name: "Set up JDK 17"
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: "Install LLVM 16"
- name: "Install LLVM 17"
uses: KyleMayes/install-llvm-action@v1
with:
force-version: true
ubuntu-version: 22.04
version: 17.0.2
version: 17.0.6
- name: "Build with Gradle"
uses: gradle/gradle-build-action@v2
with:
arguments: build
arguments: build
- name: "Generate Allure Report"
uses: gradle/gradle-build-action@v3
if: always()
with:
arguments: allureAggregateReport
- name: "Publish Allure Report"
uses: actions/upload-artifact@v4
if: always()
with:
name: ubuntu-22.04-llvm-17
path: "build/reports/allure-report/allureAggregateReport/index.html"
19 changes: 15 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,30 @@ on: [pull_request,workflow_dispatch]
jobs:
build:
name: "build"
runs-on: windows-2022
runs-on: windows-latest
timeout-minutes: 10
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: "Set up JDK 17"
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: "Build with Gradle"
uses: gradle/gradle-build-action@v2.8.0
uses: gradle/gradle-build-action@v3
with:
arguments: build
- name: "Generate Allure Report"
uses: gradle/gradle-build-action@v3
if: always()
with:
arguments: allureAggregateReport
- name: "Publish Allure Report"
uses: actions/upload-artifact@v4
if: always()
with:
name: windows-latest
path: "build/reports/allure-report/allureAggregateReport/index.html"
55 changes: 29 additions & 26 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
= gradle-metal
:author: Pedro Lamarão <pedro.lamarao@gmail.com>

Gradle Metal is a suite of Gradle plugins supporting development for the bare metal,
Gradle Metal is a suite of Gradle plugins for bare metal development,
primarily design to support project link:https://github.com/pedrolamarao/metal[Metal].

Features:

* compile assembler, c and c++ (including c++ module interfaces)
* assemble archives and executables
* build target support (e.g. `x86_64-elf`)
* generate compilation commands database
* source dependency on included project
* compile assembler, c and c++ sources (with support for c++ modules)
* assemble applications and (static) libraries
* cross-compilation support
* compilation commands database support
* source dependency on included project or build
* binary dependency on prebuilt external project
* LLVM tools
Expand All @@ -19,15 +19,31 @@ This project is under early development.
Compatibility *will be broken* without prior notice.
In particular, we will *not* stabilize our Gradle dependency before Gradle 9.

A C++ library project with modules support is defined as simply as:

[source,kotlin]
----
plugins {
id("br.dev.pedrolamarao.metal.library")
id("br.dev.pedrolamarao.metal.cxx")
}
library {
compileOptions = listOf("-std=c++20")
}
----

Check the link:samples[] for a variety of use-cases.

Current requirements:

* Gradle 8.4 or newer
* Gradle 8.6 or newer
* JDK 17 or newer
* LLVM 16 or newer (with clang, clang-scan-deps, lld, llvm-ar etc.)
* LLVM 16 or newer (with `clang`, `clang-scan-deps`, `lld`, `llvm-ar` etc.)
To use the development version, you may install from source with `./gradlew publishToMavenLocal` and configure your project's settings like this:

[source]
[source,kotlin]
----
pluginManagement {
repositories {
Expand All @@ -36,32 +52,19 @@ pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("br.dev.pedrolamarao.metal.")) {
useModule("br.dev.pedrolamarao.gradle.metal:plugins:0.4")
useModule("br.dev.pedrolamarao.gradle.metal:plugins:0.5")
}
}
}
}
----

Check the link:samples[] for a variety of use-cases.

Plugins:

* `br.dev.pedrolamarao.metal.base`: adds the Gradle Metal service and extension
* `br.dev.pedrolamarao.metal.application`: conventional application project
* `br.dev.pedrolamarao.metal.archive`: conventional archive project
* `br.dev.pedrolamarao.metal.asm`: adds assembler source sets
* `br.dev.pedrolamarao.metal.c`: adds C sources sets
* `br.dev.pedrolamarao.metal.cpp`: adds C preprocessor source sets
* `br.dev.pedrolamarao.metal.cxx`: adds C++ module implementation source sets
* `br.dev.pedrolamarao.metal.ixx`: adds C++ module interface source sets
Under construction:

* build flavour support (e.g. `debug`, `release`)
* shared library component
* build flavour (e.g. `debug`, `release`)
* shared library
* source dependencies on cmake project
* binary dependencies on maven repository
* binary dependencies from maven repository
* GCC tools
* MSVC tools
Expand Down
18 changes: 16 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
// Copyright (c) Pedro Lamarão <pedro.lamarao@gmail.com>. All rights reserved.

import io.qameta.allure.gradle.base.tasks.ConditionalArgumentProvider

plugins {
id("base")
id("io.qameta.allure-aggregate-report")
}

group = "br.dev.pedrolamarao.gradle.metal"
version = "0.4"
version = "0.5"

allure {
environment.put("ALLURE_NO_ANALYTICS","true")
environment.put("JAVA_HOME",System.getProperty("java.home"))
version = "2.25.0"
}

subprojects {
group = rootProject.group
version = rootProject.version
}

tasks.allureAggregateReport.configure {
argumentProviders += ConditionalArgumentProvider( project.provider { listOf("--single-file") } )
clean = true
}

tasks.wrapper.configure {
gradleVersion = "8.4"
gradleVersion = "8.6"
}
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,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading

0 comments on commit afc968d

Please sign in to comment.