Skip to content

Commit 43b5937

Browse files
fixes for publishToMavenLocal
Signed-off-by: bharath-techie <[email protected]>
1 parent 7f6d309 commit 43b5937

File tree

4 files changed

+56
-44
lines changed

4 files changed

+56
-44
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,7 @@ doc-tools/missing-doclet/bin/
7878
/plugins/dataformat-csv/jni/Cargo.lock
7979

8080
/modules/parquet-data-format/src/main/rust/target
81+
/modules/parquet-data-format/src/main/rust/debug
8182
/modules/parquet-data-format/src/main/resources/native/
83+
/modules/parquet-data-format/jni/target/debug
84+

modules/parquet-data-format/build.gradle

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,6 @@ tasks.register("preparePluginPathDirs") {
3333
publishing {
3434
publications {
3535
pluginZip(MavenPublication) { publication ->
36-
pom {
37-
name = pluginName
38-
description = pluginDescription
39-
licenses {
40-
license {
41-
name = "The Apache License, Version 2.0"
42-
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
43-
}
44-
}
45-
developers {
46-
developer {
47-
name = "OpenSearch"
48-
url = "https://github.com/opensearch-project/opensearch-plugin-template-java"
49-
}
50-
}
51-
}
5236
}
5337
}
5438
}
@@ -167,8 +151,58 @@ run {
167151

168152
// updateVersion: Task to auto update version to the next development iteration
169153
tasks.register('buildRust', Exec) {
170-
workingDir = file("${projectDir}/src/main/rust")
171-
commandLine = ['cargo', 'build', '--release']
154+
// workingDir = file("${projectDir}/src/main/rust")
155+
// commandLine = ['cargo', 'build', '--release']
156+
157+
description = 'Build the Rust JNI library using Cargo'
158+
group = 'build'
159+
160+
workingDir file('src/main/rust')
161+
162+
// Determine the target directory and library name based on OS
163+
def osName = System.getProperty('os.name').toLowerCase()
164+
def libPrefix = osName.contains('windows') ? '' : 'lib'
165+
def libExtension = osName.contains('windows') ? '.dll' : (osName.contains('mac') ? '.dylib' : '.so')
166+
167+
// Use debug build for development, release for production
168+
def buildType = project.hasProperty('rustRelease') ? 'release' : 'debug'
169+
def targetDir = "target/${buildType}"
170+
171+
// Find cargo executable - try common locations
172+
def cargoExecutable = 'cargo'
173+
def possibleCargoPaths = [
174+
System.getenv('HOME') + '/.cargo/bin/cargo',
175+
'/usr/local/bin/cargo',
176+
'cargo'
177+
]
178+
179+
for (String path : possibleCargoPaths) {
180+
if (new File(path).exists()) {
181+
cargoExecutable = path
182+
break
183+
}
184+
}
185+
186+
def cargoArgs = [cargoExecutable, 'build']
187+
if (buildType == 'release') {
188+
cargoArgs.add('--release')
189+
}
190+
191+
if (osName.contains('windows')) {
192+
commandLine cargoArgs
193+
} else {
194+
commandLine cargoArgs
195+
}
196+
197+
// Set environment variables for cross-compilation if needed
198+
environment 'CARGO_TARGET_DIR', file('jni/target').absolutePath
199+
200+
inputs.files fileTree('src/main/rust/src')
201+
inputs.file 'src/main/rust/Cargo.toml'
202+
// outputs.files file("jni/${targetDir}/${libPrefix}opensearch_datafusion_jni${libExtension}")
203+
// System.out.println("Building Rust library in ${buildType} mode");
204+
205+
172206
}
173207

174208
tasks.register('copyNativeLib', Copy) {

plugins/workload-management/wlm-spi/src/main/java/org/opensearch/plugin/wlm/spi/CatalogSnapshotMetadata.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/framework/src/main/java/org/opensearch/index/engine/TranslogHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public Engine.Operation convertToEngineOp(Translog.Operation operation, Engine.O
153153
true,
154154
SequenceNumbers.UNASSIGNED_SEQ_NO,
155155
SequenceNumbers.UNASSIGNED_PRIMARY_TERM
156+
,null // TODO
156157
);
157158
return engineIndex;
158159
case DELETE:

0 commit comments

Comments
 (0)