Skip to content

Commit abb53b5

Browse files
Cherry-picks #306 (#307)
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
1 parent 94d4d15 commit abb53b5

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

CedarJava/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 4.3.1
4+
### Added
5+
* Added Zig version validation for publishing artifacts [#306](https://github.com/cedar-policy/cedar-java/pull/306)
6+
37
## 4.3.0
48
### Added
59
* Introduced new model classes for improved type safety and functionality:

CedarJava/build.gradle

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,26 @@ tasks.register('installCargoZigbuild', Exec) {
124124
commandLine 'cargo', '+' + RustVersion, 'install', 'cargo-zigbuild@0.19.7'
125125
}
126126

127+
def ZigVersion = '0.11'
128+
tasks.register('validateZigVersion') {
129+
group = 'Build'
130+
description = 'Validates that the correct zig version is installed'
131+
132+
doLast {
133+
def output = new ByteArrayOutputStream()
134+
exec {
135+
commandLine 'zig', 'version'
136+
standardOutput = output
137+
}
138+
def version = output.toString().trim()
139+
println "Detected Zig version: ${version}"
140+
if (!version.startsWith(ZigVersion)) {
141+
throw new GradleException("Zig version must be ${ZigVersion} but found: ${version}")
142+
}
143+
println "Zig version validation successful"
144+
}
145+
}
146+
127147
tasks.register('compileFFI') {
128148
dependsOn('installCargoZigbuild')
129149
group 'Build'
@@ -252,13 +272,14 @@ java {
252272
/*
253273
Configures Maven publishing
254274
*/
275+
publish.dependsOn('validateZigVersion')
255276
publishing {
256277
publications {
257278
mavenJava(MavenPublication) {
258279
from components.java
259280
groupId = 'com.cedarpolicy'
260281
artifactId = 'cedar-java'
261-
version = '4.3.0'
282+
version = '4.3.1'
262283

263284
artifacts {
264285
jar

CedarJavaFFI/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "Java FFI for Cedar (from the cedar-policy crate)."
66
edition = "2021"
77

88

9-
version = "4.3.0"
9+
version = "4.3.1"
1010

1111
[dependencies]
1212
serde = { version = "1.0", features = ["derive", "rc"] }

0 commit comments

Comments
 (0)