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

Integrate next #73

Merged
merged 61 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
569a0d8
Advance to version 0.2
pedrolamarao Oct 3, 2023
8daff28
Remove explicit root project name.
pedrolamarao Oct 3, 2023
c9209f4
Add a prerelease identifier.
pedrolamarao Oct 3, 2023
25a3ec0
Set linker to clang++.
pedrolamarao Oct 3, 2023
0d52f11
Update link.
pedrolamarao Oct 4, 2023
95a2b10
Discover target host (#42)
pedrolamarao Oct 5, 2023
26e4cda
Conventional archive adds a test application (#43)
pedrolamarao Oct 5, 2023
de3afda
When configuring ixx includes, configure also commands task (#44)
pedrolamarao Oct 5, 2023
51ac36b
Test compile option inheritance.
pedrolamarao Oct 5, 2023
6392a31
Merge remote-tracking branch 'github/next' into next
pedrolamarao Oct 6, 2023
4cb5d0c
Expose locateTool (#47)
pedrolamarao Oct 7, 2023
8b60174
Update CI; add LLVM 17. (#48)
pedrolamarao Oct 8, 2023
ddd0549
Get path from providers.
pedrolamarao Oct 9, 2023
697588c
Add a run task for conventional application components.
pedrolamarao Oct 9, 2023
65df908
Wire the main module to the test module.
pedrolamarao Oct 9, 2023
81c6a5f
Don't apply cpp plugin
pedrolamarao Oct 10, 2023
3b61c0f
Require JDK 17
pedrolamarao Oct 10, 2023
2d0bdf6
Shorten notation of test files.
pedrolamarao Oct 10, 2023
3f799f8
API for conventional archive and executable file names (#50)
pedrolamarao Oct 10, 2023
4cc8309
Merge remote-tracking branch 'github/next' into next
pedrolamarao Oct 10, 2023
a02cbfe
API to define includables etc. as public or private. (#51)
pedrolamarao Oct 10, 2023
c681e53
Add MetalService::getHost and MetalService::getTarget.
pedrolamarao Oct 11, 2023
651a1ad
Remove getLinkables, use SourceTask::source.
pedrolamarao Oct 11, 2023
cddb1db
Wire run-test to test to check.
pedrolamarao Oct 11, 2023
4afa361
API for set of enabled targets (#53)
pedrolamarao Oct 13, 2023
b22826c
Avoid linking empty source set. (#55)
pedrolamarao Oct 16, 2023
24d849d
Add javadoc.
pedrolamarao Oct 16, 2023
d5a654b
Update to 0.3-next
pedrolamarao Oct 16, 2023
d72ad8d
Update samples.
pedrolamarao Oct 17, 2023
f3d6b86
Ignore sample external src.
pedrolamarao Oct 17, 2023
71170d4
Locate tools with metal extension.
pedrolamarao Oct 17, 2023
a8534bc
Update version string.
pedrolamarao Oct 17, 2023
d97eb50
Fix runTask onlyIf targets is empty i.e. default.
pedrolamarao Oct 17, 2023
24139ea
Add onlyIf reason.
pedrolamarao Oct 17, 2023
eb7c92d
Advance version to 0.3-rc-1
pedrolamarao Oct 17, 2023
1d80db7
Advance version to 0.4
pedrolamarao Oct 18, 2023
4e55bab
Define publish workflow
pedrolamarao Oct 18, 2023
38ca8c7
Try --validate-only first
pedrolamarao Oct 18, 2023
cb3d258
Fix workflow name
pedrolamarao Oct 18, 2023
bf2ed76
Improve source sets (#59)
pedrolamarao Oct 23, 2023
c3db48d
Enable configuration cache (#60)
pedrolamarao Oct 24, 2023
0b2ef32
Annotate cacheable tasks. (#63)
pedrolamarao Nov 3, 2023
a13f300
Propagate build environment metal.path property into tests (#64)
pedrolamarao Nov 6, 2023
3c1c051
Component specific dependencies. (#68)
pedrolamarao Nov 24, 2023
a807f83
Remove --validate-only (#70)
pedrolamarao Nov 24, 2023
b392d93
Advance version to 0.5
pedrolamarao Nov 25, 2023
0b881a6
Update Gradle to 8.5-rc-4
pedrolamarao Nov 25, 2023
2d46203
Fix archive file name.
pedrolamarao Nov 25, 2023
0cdec14
Update application samples.
pedrolamarao Nov 25, 2023
edfec6c
Remove obsolete samples.
pedrolamarao Nov 25, 2023
eb2e4d8
Update README.
pedrolamarao Nov 25, 2023
82a2a95
Replace with clang generated source.
pedrolamarao Nov 25, 2023
21bfe05
Update archive samples.
pedrolamarao Nov 25, 2023
eaa181d
Update dependency samples.
pedrolamarao Nov 25, 2023
c02a4a1
New design (#71)
pedrolamarao Feb 21, 2024
3d635a5
Add DSL for component source filters (#72)
pedrolamarao Feb 21, 2024
555353f
Merge branch 'next' into chore/integrate-next
pedrolamarao Feb 21, 2024
c21c937
Remove obsolete code.
pedrolamarao Feb 21, 2024
58cac7e
Remove obsolete code.
pedrolamarao Feb 21, 2024
7b7ee8c
Update version.
pedrolamarao Feb 21, 2024
903a96c
Update version.
pedrolamarao Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>

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 <[email protected]>. 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
Loading