I am using Jenkins CI to test a Java Project. I already wrote my tests and ran them in Eclipse and everything is fine. However, I don't know what to write in the build step in the Jenkins Job.
My repository is this: (the Junit tests are in TestDFA.java)
D:\GIT\CFLOW
│ Main.java
│ PreProcessor.java
│
├───cflow
│ │ DFA.java
│ │
│ ├───exceptions
│ │ DeadState.java
│ │ InvalidStateException.java
│ │ InvalidTransitionException.java
│ │
│ └───tests
│ TestDFA.java
│
└───libs
junit.jar
I have another Python job and all that I needed to write was "python testDFA.py" but with Java it's very hard
You should try to run your test cases with Maven or with an ant script. There should be a Jenkins plugin for that, or just call ant/maven from a command line build step.
Related
I want to remove the endings after my domain, for example:
https://customdomain.com/src/loading-page/loading.html -> https://customcustomdomain.com/
Here is my file tree for GitHub Pages:
dist
│ CNAME
│ poster.png
│
└───assets
│ │ css/images/js files
│
└───src
│ │
│ └───loading-page
│ │ loading.html
│ └───main-page
│ │ main.html
Is there a specific file I can incorporate in this tree to rewrite the URL on the GitHub Pages to look like the root (no folders or files following the domain? Or some setting I can change in GitHub Pages itself?
How can I efficiently store hundreds of 3D volumes and serve selected instance slices on-demand with Flask?
I am currently solving the issue by saving each subvolume as an image collection of its slices. Here each folder is a subvolume (cropped out object) - the image names correspond to the slices of the volume from which the subvolume was cropped.
├── 1/
│ ├── 1.png
| ...
│ ├── 10.png
│ └── 11.png
├── 2/
│ ├── 0.png
| ...
│ ├── 4.png
│ └── 5.png
├── 3/
│ ├── 3.png
| ...
│ ├── 11.png
│ └── 12.png
...
|
└── 176/
├── 34.png
...
├── 43.png
└── 44.png
Instead, I would like to store each subvolume, e.g., as a single tiff file and only serve the required slices.
├── 1/
│ └── image.tif
├── 2/
│ └── image.tif
├── 3/
│ └── image.tif
...
|
└── 176/
└── image.tif
However, according to this Stackoverflow answer the only mainstream browser that supports tiff is Safari.
Is there a way where I don't have to save every single image? Especially considering that I will only need to depict the most centric slice of a subvolume in most cases and only in a few cases make the whole subvolume browsable.
I would like to integrate the python modules (in the algo/ folder) into the main program that uses an interface_ui is created by QT designer.
This is my folder structure.
├── algo/
│ └── main_algo.py
│ └── a.py
│ └── b.py
│ └── read_data.py
│ └── data/
│ └── data.bin
└── main.py
└── interface_ui.py
Note that the main_algo.py will import a.py, b.py, and read_data.py (function to read data.bin)
So, I have two solutions:
I have created a button in the interface and executed the function main_algo.py each time I push the button
exec(open("path/main_algo.py.py").read())
I would convert all the modules inside the algo/ folder into the function and call back the function in the main.py whenever I want.
import sys
sys.path.insert(1,"path_to_algo/")
from a import x,y
from b import z
import read_data
Please tell me the advantages of each solutions and how can we do the second solution.
Thank you very much
I have a folder structure like this:
.
├── dist/
└── src/
├── index.php
└── projects/
├── some-project/
│ ├── main.css
│ ├── main.js
│ └── index.html
└── N'th project/ ...
I need to minify and move every project inside src/ to dist/ without breaking folder structure. Should look like this:
.
├── dist/
│ ├── index.php
│ └── projects/
│ ├── some-project/
│ │ ├── main.css(minified)
│ │ ├── main.js(minified)
│ │ └── index.html
│ └── N'th project/ (also minified) ...
└── src/
├── index.php
└── projects/
├── some-project/
│ ├── main.css
│ ├── main.js
│ └── index.html
└── N'th project/ ...
Thanks for your time.
I solved it with something like this. If any one want to use:
.pipe(gulp.dest(function(file){
let splittedUrl = file.history[0].split("\\");
let projectName = splittedUrl.slice(splittedUrl.indexOf("projects"),-1);
//console.log(projectName.join("/"));
return "dist/" + projectName.join("/");
}));
gulp.task("projectTest", () => {
return gulp.src("./src/projects/**/*.css")
// minify pipe, etc.
.pipe(gulp.dest('dist/projects'))
});
From https://gulpjs.com/docs/en/api/concepts#glob-base:
A glob base - sometimes called glob parent - is the path segment
before any special characters in a glob string. As such, the glob base
of /src/js/**.js is /src/js/. All paths that match the glob are
guaranteed to share the glob base - that path segment can't be
variable.
Vinyl instances generated by src() are constructed with the glob base
set as their base property. When written to the file system with
dest(), the base will be removed from the output path to preserve
directory structures.
That is a little confusing as written. In my code the part before the globstar ** is the base. So ./src/projects/ is the base. And the directory structure under the base is always preserved - but that wouldn't include projects (because that is part of the base and will be removed automatically in gulp.dest).
In the dest pipe, the directory structures (project1, project2, etc.) are still there but would be sent to your dest folder without the base path at the beginning. So you will need to add whatever part of that base path back into your dest folder if you want it.
So gulp.dest('dist/projects') to get the preserved folder structure put back under projects as you want.
So if what I said is true, this alternative should work as well:
gulp.task("projectTest", () => {
// return gulp.src("./src/projects/**/*.css")
return gulp.src("./src/**/*.css")
// .pipe(gulp.dest('dist/projects'))
.pipe(gulp.dest('dist'))
});
Now the directory structure under src is preserved (becasue src is the base). So you get the same result just sending all that to dist.
You can decide which form you prefer, I think the first version is a little clearer. And if there are files under src that you do not want captured by the gulp.src glob.
My goal is to find the binaries in here, and elevate them to the first subdir in exe dir.
My simplified (in reality it has more junk, more subdirs) folder structure is this:
src
├── exe
│ └── nix
│ └── binary.out
│ └── blah
│ └── mac
│ └── binary.out
│ └── blah
│ └── win
│ └── src
│ └── trigger
│ └── trigger
│ └── trigger
│ └── binary.exe
│ └── Debug
My goal is to copy just the binary files into dist/exe like this:
dist
├── exe
│ └── nix
│ └── binary.out
│ └── mac
│ └── binary.out
│ └── win
│ └── binary.exe
This is the code I use right now:
var path = require('path');
gulp.src(['src/exe/**/*.out', 'src/exe/**/*.exe'])
.pipe(gulp.dest(function(file) {
var os = file.path.match(/(?:win|mac|nix)/)[0];
return 'dist/exe/' + os + '/' + path.basename(file.path);
}));
However this is still copying the structure even after the os name. It's like it appends the **/ stuff after my returned string. Is there any way to make it not do this?
It like appends the **/ stuff after my returned string. Is there anyway to make it not do this
Yep, that's exactly what it does and it's intentional. Anything before the ** is treated as the base path, anything after is the path that is used when writing the file to the destination directory. (See this answer if you want to know more).
Normally you could use the base option in gulp.src() to change this, but this doesn't really work in your case since you would need one base path for nix/mac and another one for win.
On top of all that you're using gulp.dest() wrong. gulp.dest() specifies the destination directory. You're trying to use it to specify a destination file. That's not possible.
The easiest solution for you is to use gulp-rename:
var path = require('path');
var rename = require('gulp-rename');
gulp.src(['src/exe/**/binary.{exe,out}'])
.pipe(rename(function(file) {
file.dirname = file.dirname.split(path.sep)[0];
}))
.pipe(gulp.dest('dist/exe'));