I'm trying to generate an xsd schema with xjc.
The problem is that the xjc creates sub folders by the -p (package) flag.
Example:
If ill run xjc from c: with -p a.b.c like this:
C:>xjc.exe -p a.b.c schema.xsd
The xjc will create the a,b,c folders and the generated files will be located in c:/a/b/c
Even if ill specified a -d (directory) flag
Like this:
C:>xjc.exe -p a.b.c -d c:/files schema.xsd
The files will be located in c:/files/a/b/c
How can I get the xjc to not create this folders?
If I execute:
C:>xjc.exe -p a.b.c -d c:/files schema.xsd
The files will be located in c:/files,with package a.b.c.
Related
I'm using cmake to copy a soft link 'libbssl.so' (which has target libssl.so.3) to a build subdirectory.
COMMAND ${CMAKE_COMMAND} -E copy ${OPENSSL_SSL_LIBRARY} ${CMAKE_CURRENT_BINARY_DIR}/lib
The copy command works as expected and copies the file, however with libssl.so as the filename and not libssl.so.3. How do I get cmake to save the filename as libssl.so.3 keeping in mind that I don't necessarily know this name in advance, i.e., I don't want to hard code it. I'm using find_package(OpenSSL).
I don't know about a convenient way to use the cmake command linke tool for this directly, but starting CMake 3.15, cmake provides the FOLLOW_SYMLINK_CHAIN for file(COPY) for copying the library file including the full symlink chain to the target directory.
You could create a cmake script to execute as command.
copy_symlink_chain.cmake
#[===[
Params:
LIBRARY : the name of the symlink to the lib
DESTINATION : the directory to copy the files to
]===]
file(COPY "${LIBRARY}" DESTINATION "${DESTINATION}" FOLLOW_SYMLINK_CHAIN)
...
COMMAND ${CMAKE_COMMAND} -D "LIBRARY=${OPENSSL_SSL_LIBRARY}" -D "DESTINATION=${CMAKE_CURRENT_BINARY_DIR}/lib" -P ${CMAKE_CURRENT_SOURCE_DIR}/copy_symlink_chain.cmake
...
unzip -d option to extract file from jar to specific directory
Without using any option we can unzip specific file to same directory structure, but -d option doesn't seem to work.
unzip someNiceOne.jar com/some/comp/some/dir/name.properties
This will unzip file 'name.properties' to 'com/some/comp/some/dir/'.
I need 'name.properties' to be under same directory level where my jar is present, but -d option doesn't seem to work. Any alternative option?.
unzip -d option help :
-d extract files into exdir
Using -j option should do what you need.
-j junk paths (do not make directories)
In your case:
unzip -j someNiceOne.jar com/some/comp/some/dir/name.properties
Right now to create an extension with Google Chrome Extensions page we select a directory that contains created extension and it generates .crx file.
The problem is that it contains all files from this directory - for example, all docs, asset drafts, etc.
Is it possible to create some blacklist to ignore specified files like *.psd, *.pdf, docs/* ... ?
The Chromium team decided not to implement a manifest (or similar mechanism) for including only the desired files in a .CRX.
The recommended workflow is to have a build step that outputs only the needed files in a dist directory, and to create the CRX from that directory. This is common practice for JavaScript libraries.
My solution
I have created a .crxignore custom ignore file, like this:
.*
Makefile
*.md
bin
It is made for zip command! It is different than .gitignore. You can't add comments eg! See documentation: https://linux.die.net/man/1/zip , look for --exclude word.
Now you can create a zip without ignred files:
$ zip -qr -9 -X .out/out.zip . -x#.crxignore
# ^^^^^^^^^^^^^ using ignore file
After that I can convert zip to crx file with this go script: https://github.com/mmadfox/go-crx3 You have to build it with go build -o out/crx3 crx3/main.go command (you may get missing mod errors, but there will be the commands what you have to run). --> you can move your out/crx3 to where you want. Eg: [project]/bin/crx3.
I haven't tried, maybe chrome command also can convert zip to crx.
You have to generate a private key:
$ bin/crx3 keygen .out/key.pem
Final Makefile
build:
rm -f .out/out.zip
zip -qr -9 -X .out/out.zip . -x#.crxignore
bin/crx3 pack .out/out.zip -p .out/key.pem -o .out/out.crx
Build process:
$ make build
# --> build the .out/out.crx file
Try the command line program "zip", which could be found in cygwin if you're on windows, or is likely present on OSX, and easy to install if you're using linux.
zip package.zip -r * -x package.sh -x *.git* -x "*.*~" -x "*.pdf" docs/* "*.psd"
I am using this command to winzip a folder, but "bldforge_AOMS_DEV\WebSphere_AVOB" is included in the zip.
winzip32.exe -min -a -r -p C:\Build\AOM.zip m:\bldforge_AOMS_DEV\WebSphere_AVOB*
How can I create the zip without "bldforge_AOMS_DEV\WebSphere_AVOB", just all the files under bldforge_AOMS_DEV\WebSphere_AVOB\?
Thanks
Jirong
I'm no expert by i think this might solve you problem
winzip32.exe -min -a -r -p C:\Build\AOM.zip m:\bldforge_AOMS_DEV\WebSphere_AVOB\*
just add a slash before your * selector
I'm trying to apply a patch using 2 files in different directories. The output file should be in a different directory too. The first file is in /var/local/documents/document.xml and patch file is located in /var/local/patches/patch.diff and I want the output file should be created in /var/local/final/final.xml.
When the files are located in the same directory, this command works:
patch document.xml -i patch.diff -o final.xml
But when they are in separate directories and I try to use the following command:
patch
/var/local/documents/document.xml -i
/var/local/patches/patch.diff -o
/var/local/final/final.xml
I get the following error:
(Stripping trailing CRs from patch.)
patching file {file}
Hunk#1 FAILED at 20.
1 out of 1 hunk FAILED -- saving rejects to file {file}
I've read somewhere that I should use -d and -p to work correctly with directories but I have no clue how I should do it...
Yes, it's -p switch (in your case it should strip 2 entries from patch path):
cd /var/local/documents
patch -p 2 -o ../final/final.xml document.xml < ../patches/patch.diff
Try this:
$ mv /var/local/final/final.xml /var/local/final/document.xml
$ (cd /var/local/final && patch document.xml) < patch.diff
$ mv /var/local/final/document.xml /var/local/final/final.xml