Skip to content

Commit

Permalink
chore: Renamed java packages. (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
amunra authored Jan 19, 2023
1 parent 4204b2b commit c3d1ccd
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
run: mvn package

- name: Runnig the example
run: java -cp "./rust-maven-example/target/rust-maven-example-1.0.0-SNAPSHOT.jar${{ matrix.path-sep }}./jar-jni/target/jar-jni-1.0.0-SNAPSHOT.jar" io.questdb.rust.maven.example.Main
run: java -cp "./rust-maven-example/target/rust-maven-example-1.0.0-SNAPSHOT.jar${{ matrix.path-sep }}./jar-jni/target/jar-jni-1.0.0-SNAPSHOT.jar" io.questdb.example.rust.Main
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To build the project and example:
git clone https://github.com/questdb/rust-maven-plugin.git
cd rust-maven-plugin
mvn clean package
java -cp "./rust-maven-example/target/rust-maven-example-1.0.0-SNAPSHOT.jar:./jar-jni/target/jar-jni-1.0.0-SNAPSHOT.jar" io.questdb.rust.maven.example.Main
java -cp "./rust-maven-example/target/rust-maven-example-1.0.0-SNAPSHOT.jar:./jar-jni/target/jar-jni-1.0.0-SNAPSHOT.jar" io.questdb.example.rust.Main
```

To run Maven goals directly from the command line.
Expand Down
14 changes: 4 additions & 10 deletions rust-maven-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,10 @@
</properties>

<dependencies>
<dependency>
<groupId>io.questdb</groupId>
<artifactId>rust-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.questdb</groupId>
<artifactId>jar-jni</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

Expand All @@ -66,7 +60,7 @@
<plugin>
<groupId>io.questdb</groupId>
<artifactId>rust-maven-plugin</artifactId>
<version>${project.version}</version>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>str-reverse</id>
Expand Down Expand Up @@ -104,7 +98,7 @@
Copy the generated binaries to the "classes" directory in the build target.
We use this path because it will be bundled automatically into the final jar.
-->
<copyTo>${project.build.directory}/classes/io/questdb/rust/maven/example/libs</copyTo>
<copyTo>${project.build.directory}/classes/io/questdb/example/rust/libs</copyTo>

<!--
Further nest copy into a child directory named through the following expression:
Expand All @@ -118,7 +112,7 @@
Additional environment variables used when calling `cargo build`.
-->
<environmentVariables>
<REVERSED_STR_PREFIX>Great scott! A reversed string!</REVERSED_STR_PREFIX>
<REVERSED_STR_PREFIX>Great Scott, A reversed string!</REVERSED_STR_PREFIX>
</environmentVariables>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
******************************************************************************/

package io.questdb.rust.maven.example;
package io.questdb.example.rust;

import io.questdb.jar.jni.JarJniLoader;

Expand All @@ -34,7 +34,7 @@ public class Main {
Main.class,

// A platform-specific path is automatically suffixed to path below.
"/io/questdb/rust/maven/example/libs",
"/io/questdb/example/rust/libs",

// The "lib" prefix and ".so|.dynlib|.dll" suffix are added automatically as needed.
"str_reverse");
Expand Down
2 changes: 1 addition & 1 deletion rust-maven-example/src/main/rust/str-reverse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use jni::objects::{JClass, JString};
use jni::sys::jstring;

#[no_mangle]
pub extern "system" fn Java_io_questdb_rust_maven_example_Main_reversedString(
pub extern "system" fn Java_io_questdb_example_rust_Main_reversedString(
env: JNIEnv,
_class: JClass,
input: JString) -> jstring {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
******************************************************************************/

package io.questdb.rust.maven.plugin;
package io.questdb.maven.rust;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
Expand Down Expand Up @@ -162,7 +162,7 @@ private String getName() {
}

private File getTargetDir() {
return new File(new File(project.getBuild().getDirectory()), getName());
return new File(new File(new File(project.getBuild().getDirectory()), "rust-maven-plugin"), getName());
}

private void runCommand(List<String> args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
******************************************************************************/

package io.questdb.rust.maven.plugin;
package io.questdb.maven.rust;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
******************************************************************************/

package io.questdb.rust.maven.plugin;
package io.questdb.maven.rust;

import java.util.List;
import java.util.regex.Pattern;
Expand Down

0 comments on commit c3d1ccd

Please sign in to comment.