pub struct Project {
files: Vec<File>,
names: Vec<String>,
classpath: Vec<String>,
sourcepath: Vec<String>,
root_dir: String,
}
Expand description
Struct representing a Java project.
Any index i
in any collection in this struct always refers to the same
JavaFile.
Fields§
§files: Vec<File>
Collection of java files in this project
names: Vec<String>
Names of java files in this project.
classpath: Vec<String>
Classpath
sourcepath: Vec<String>
Source path
root_dir: String
Root directory
Implementations§
source§impl Project
impl Project
sourcepub fn check_health(&self) -> Result<()>
pub fn check_health(&self) -> Result<()>
Checks the project for common CodingRooms errors
source§impl Project
impl Project
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Initializes a Project, by discovering java files in the
UMM_DIR directory. Also downloads some jar
files required for unit testing and mutation testing.
sourcepub fn new_script() -> Result<Self, Box<EvalAltResult>>
pub fn new_script() -> Result<Self, Box<EvalAltResult>>
Macro generated variant of #fn_name that returns EvalAltResult. This allows the function to be used in scripts.
sourcepub fn identify(&self, name: &str) -> Result<File>
pub fn identify(&self, name: &str) -> Result<File>
Attempts to identify the correct file from the project from a partial or fully formed name as expected by a java compiler.
Returns a reference to the identified file, if any.
name
: partial/fully formed name of the Java file to look for.
sourcepub fn identify_mut_script(
&mut self,
name: &str
) -> Result<File, Box<EvalAltResult>>
pub fn identify_mut_script( &mut self, name: &str ) -> Result<File, Box<EvalAltResult>>
Macro generated variant of #fn_name that returns EvalAltResult. This allows the function to be used in scripts.
sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
Returns true if project contains a file with the given name.
sourcepub async fn download_libraries_if_needed(&self) -> Result<()>
pub async fn download_libraries_if_needed(&self) -> Result<()>
Downloads certain libraries like JUnit if found in imports. times out after 20 seconds.
sourcepub async fn update_vscode_settings(&self) -> Result<()>
pub async fn update_vscode_settings(&self) -> Result<()>
Creates a vscode settings.json file for the project.
sourcepub fn info_script(&self) -> Result<(), Box<EvalAltResult>>
pub fn info_script(&self) -> Result<(), Box<EvalAltResult>>
Macro generated variant of #fn_name that returns EvalAltResult. This allows the function to be used in scripts.
sourcepub fn describe(&self) -> String
pub fn describe(&self) -> String
Returns a short summary of the project, it’s files, their fields and methods.
sourcepub async fn update_vscode_tasks(&self) -> Result<()>
pub async fn update_vscode_tasks(&self) -> Result<()>
Writes a .vscode/tasks.json file for the project.
sourcepub fn serve_project_code(&self) -> Result<()>
pub fn serve_project_code(&self) -> Result<()>
Serves the project code as a static website.