Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CedarJava/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased
### Added
* Added Zig version validation for publishing artifacts [#306](https://github.com/cedar-policy/cedar-java/pull/306)

## 4.3.0
### Added
* Introduced new model classes for improved type safety and functionality:
* `com.cedarpolicy.model.Context` - Policy context representation (will replace `Map<String,Value>`) [#286](https://github.com/cedar-policy/cedar-java/pull/286)
* `com.cedarpolicy.model.entity.Entities` - Entity collection management (will replace `Set<Entity>`) [#293](https://github.com/cedar-policy/cedar-java/pull/293)
Expand Down
21 changes: 21 additions & 0 deletions CedarJava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,26 @@ tasks.register('installCargoZigbuild', Exec) {
commandLine 'cargo', '+' + RustVersion, 'install', 'cargo-zigbuild@0.19.7'
}

def ZigVersion = '0.11'
tasks.register('validateZigVersion') {
group = 'Build'
description = 'Validates that the correct zig version is installed'

doLast {
def output = new ByteArrayOutputStream()
exec {
commandLine 'zig', 'version'
standardOutput = output
}
def version = output.toString().trim()
println "Detected Zig version: ${version}"
if (!version.startsWith(ZigVersion)) {
throw new GradleException("Zig version must be ${ZigVersion} but found: ${version}")
}
println "Zig version validation successful"
}
}

tasks.register('compileFFI') {
dependsOn('installCargoZigbuild')
group 'Build'
Expand Down Expand Up @@ -252,6 +272,7 @@ java {
/*
Configures Maven publishing
*/
publish.dependsOn('validateZigVersion')
publishing {
publications {
mavenJava(MavenPublication) {
Expand Down