forked from Cutieguwu/raven
Fix build; Correct target/ path in generated .gitignore
This commit is contained in:
10
assets/src/test/MainTest.java
Normal file
10
assets/src/test/MainTest.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
public class MainTest {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
testAdd();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void testAdd() {
|
||||||
|
assert Main.add(2, 2) == 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/main.rs
13
src/main.rs
@@ -140,6 +140,7 @@ fn init() -> anyhow::Result<()> {
|
|||||||
f.write_all(include_bytes!("../assets/src/main/Main.java"))?;
|
f.write_all(include_bytes!("../assets/src/main/Main.java"))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
// Make src/test/Test.java
|
// Make src/test/Test.java
|
||||||
if let Result::Ok(mut f) = OpenOptions::new().write(true).create_new(is_empty).open(
|
if let Result::Ok(mut f) = OpenOptions::new().write(true).create_new(is_empty).open(
|
||||||
DIR_TEST
|
DIR_TEST
|
||||||
@@ -148,6 +149,16 @@ fn init() -> anyhow::Result<()> {
|
|||||||
.with_extension(JAVA_EXT_SOURCE),
|
.with_extension(JAVA_EXT_SOURCE),
|
||||||
) {
|
) {
|
||||||
f.write_all(include_bytes!("../assets/src/test/Test.java"))?;
|
f.write_all(include_bytes!("../assets/src/test/Test.java"))?;
|
||||||
|
=======
|
||||||
|
// Make src/test/MainTest.java
|
||||||
|
if let Result::Ok(mut f) = OpenOptions::new().write(true).create_new(is_empty).open(
|
||||||
|
DIR_TEST
|
||||||
|
.clone()
|
||||||
|
.join("MainTest")
|
||||||
|
.with_extension(JAVA_EXT_SOURCE),
|
||||||
|
) {
|
||||||
|
f.write_all(include_bytes!("../assets/src/test/MainTest.java"))?;
|
||||||
|
>>>>>>> e79c26c (Fix build; Correct target/ path in generated .gitignore)
|
||||||
}
|
}
|
||||||
|
|
||||||
// git init .
|
// git init .
|
||||||
@@ -164,7 +175,7 @@ fn init() -> anyhow::Result<()> {
|
|||||||
f.read_to_string(&mut buf)?;
|
f.read_to_string(&mut buf)?;
|
||||||
|
|
||||||
for ignored in [
|
for ignored in [
|
||||||
DIR_TARGET.as_path().display().to_string(),
|
format!("{}/", DIR_TARGET.file_name().unwrap().display()),
|
||||||
format!("*.{}", JAVA_EXT_CLASS),
|
format!("*.{}", JAVA_EXT_CLASS),
|
||||||
] {
|
] {
|
||||||
if !buf.contains(&ignored) {
|
if !buf.contains(&ignored) {
|
||||||
|
|||||||
Reference in New Issue
Block a user