Skip to content

Commit

Permalink
✨ feat: Add Swc4j
Browse files Browse the repository at this point in the history
  • Loading branch information
caoccao committed Mar 6, 2024
1 parent 206b881 commit 5755b9e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 21 deletions.
21 changes: 0 additions & 21 deletions rust/src/jni/com_caoccao_javet_swc4j_SWCNative.h

This file was deleted.

26 changes: 26 additions & 0 deletions src/main/java/com/caoccao/javet/swc4j/Swc4j.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2024. caoccao.com Sam Cao
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.caoccao.javet.swc4j;

public final class Swc4j {
public Swc4j() {
}

public String getVersion() {
return SwcNative.getVersion();
}
}
28 changes: 28 additions & 0 deletions src/test/java/com/caoccao/javet/swc4j/TestSwc4j.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2024. caoccao.com Sam Cao
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.caoccao.javet.swc4j;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class TestSwc4j {
@Test
public void testGetVersion() {
assertEquals("0.1.0", new Swc4j().getVersion());
}
}

0 comments on commit 5755b9e

Please sign in to comment.