I had a project that source code including non-class file in package(eg:.sql,.ftl). I want to generate output including them but the artifacts always contains class file. How can I include them?
It's a web application, and below is source structure(java code part):
src
|
main
|
java
|
package1
|
Class1.java
Class2.java
sql1.sql
sql2.sql
template1.ftl
The output only contains compiled class.
I found a solution:
Project Structure->Module:at the bottom, Exclude files:*.java
Project Structure->Artifacts:Output Layout:add 'java' directory contents to classes
Has anybody written a D library similar to Boost.Filesystem providing iterators/ranges that can do for example file system directory tree traversal?
dirEntries from std.file returns a range that enumerates files and directories, optionally under subdirectories as well.
1) I have a folder called CCBuilds containing couple of files in this path: E:\Testing\Builds\CCBuilds.
2) I have written C# code (Process.Start) to Rar this folder and save it in E:\Testing\Builds\CCBuilds.rar using the following command
"C:\program files\winrar\rar.exe a E:\Testing\Builds\CCBuilds.rar E:\Testing\Builds\CCBuilds"
3) The problem is that, though the rar file gets created properly, when I unrar the file to CCBuilds2 folder (both through code using rar.exe x command or using Extract in context menu), the unrared folder contains the full path, ie. extracting E:\Testing\Builds\CCBuilds.rar ->
E:\Testing\Builds\CCBuilds2\Testing\Builds\CCBuilds\<<my files>>
Whereas I want it to be something like this: E:\Testing\Builds\CCBuilds2\CCBuilds\<<my files>>
How can I avoid this full path persistence while adding to rar / extracting back from it. Any help is appreciated.
Use the -ep1 switch.
More info:
-ep = Files are added to an archive without including the path information. Could result in multiple files existing in the archive
with same name.
-ep1 = Do not store the path entered at the command line in archive. Exclude base folder from names.
-ep2 = Expand paths to full. Store full file paths (except drive letter and leading backslash) when archiving.
(source: http://www.qa.downappz.com/questions/winrar-command-line-to-add-files-with-relative-path-only.html)
Just in case this helps: I am currently working on an MS Access Database project (customer relations management for a small company), and one of the tasks there is to zip docx-files to be sent to customers, with a certain password encryption used.
In the VBA procedure that triggers the zip-packaging of the docx-files, I call WinRAR as follows:
c:\Programme\WinRAR\winrar.exe a -afzip -ep -pThisIsThePassword "OutputFullName" "InputFullName"
-afzip says: "Create a zip file (as opposed to a rar file)
-ep says: Do not include the paths of the source file, i.e. put the file directly into the zip folder
A full list of such switches is available in the WinRAR Help, section "Command line".
x extracts it as E:\Testing\Builds\CCBuilds2\Testing\Builds\CCBuilds\, because you're using full path when declaring the source. Either use -ep1 or set the default working dir to E:\Testing\Builds.
Use of -ep1 is needed but it's a bit tricky.
If you use:
Winrar.exe a output.rar inputpath
Winrar.exe a E:\Testing\Builds\CCBuilds.rar E:\Testing\Builds\CCBuilds
it will include the input path declared:
E:\Testing\Builds\CCBuilds -> E:\Testing\Builds\CCBuilds.rar:
Testing\Builds\CCBuilds\file1
Testing\Builds\CCBuilds\file2
Testing\Builds\CCBuilds\folder1\file3
...
which will end up unpacked as you've mentioned:
E:\Testing\Builds\CCBuilds2\Testing\Builds\CCBuilds\
There are two ways of using -ep1.
If you want the simple path:
E:\Testing\Builds\CCBuilds\
to be extracted as:
E:\Testing\Builds\CCBuilds2\CCBuilds\file1
E:\Testing\Builds\CCBuilds2\CCBuilds\file2
E:\Testing\Builds\CCBuilds2\CCBuilds\path1\file3
...
use
Winrar.exe a -ep1 E:\Testing\Builds\CCBuilds.rar E:\Testing\Builds\CCBuilds
the files inside the archive will look like:
CCBuilds\file1
CCBuilds\file2
CCBuilds\folder1\file3
...
or you could use ep1 to just add the files and folder structure sans the base folder with the help of recursion and defining the base path as the inner path of the structure:
Winrar.exe a -ep1 -r E:\Testing\Builds\CCBuilds.rar E:\Testing\Builds\CCBuilds\*
The files:
E:\Testing\Builds\CCBuilds\file1
E:\Testing\Builds\CCBuilds\file2
E:\Testing\Builds\CCBuilds\folder1\file3
...
inside the archive will look like:
file1
file2
folder1\file3
...
when extracted will look like:
E:\Testing\Builds\CCBuilds2\file1
E:\Testing\Builds\CCBuilds2\file2
E:\Testing\Builds\CCBuilds2\folder1\file3
...
Anyway, these are two ways -ep1 can be used to exclude base path with or without the folder containing the files (the base folder / or base path).
In Intellij, if I have an error in a source file, then when building I can choose "Exclude from Compile" by right-clicking on the file in the build output.
But, now I would like to include the file again. Where is the menu item that lets me put it back into the build? (The file shows in the Project window, and has a small 'x' in its icon to show it is excluded, but I see no way to get this to go away.)
Edit - I found there is a compiler.xml file, and I found I can delete the file from the "excludeFromCompile" section, but still, there must be a menu item somewhere to do this.
Settings | Compiler | Excludes.
For Intellij 14.0 on Windows, undo excludes from compilation
File -> Settings
Then inside Settings -> Build, Execution, Deployment -> Compiler -> Excludes
or just search for "excludes" to find it.
Note in IDEA v12, there is no longer a File | Settings menu option.
I'm not sure how to exclude/re-include individual files, but this is how it works for folders...
Now the menu item is File | Project Structure... and that brings up a multi-column dialog.
In the rightmost column, click Modules, then select the directory that contains the excluded folder in the second column.
If it is a folder you are trying to re-include, it is listed in the third column's directory list, and excluded folders are at the bottom, in red.
If you click on the red 'X' to the right of the folder name, it will remove the folder from the "excluded" list which has the effect of including it back in the project. Awkward and counter-intuitive, but that's how it works.
I found that johnkaplantech's answer didn't work because Idea would complain about multiple modules sharing the same root.
So I manually edited the project files to remove the exclusion. File modified was %ProjectRoot%/.idea/modules/<ModuleName>.iml. Inside module/component/content of this XML file was a tag excludeFolder. Remove that.
In IntelliJ IDEA 15.0.3 File | Settings | Build, Execution, Deployment | Compiler | Excludes | (Remove path from right list).
For Mac it would be :
1) Go to Preferences:
2) Expand Build, Execution,Deployment section
3) Expand Compiler sub section
4) All the excluded classes will be available in the Excludes
5) Delete the classes you want include for compilation and press Ok.
Hope it helps.
From menu:
File | Settings | Compiler | Excludes: you can add/remove excluded files to be compiled in the dialog.
For me excluded folders did not appear neither under File > Settings> Compiler > Excludes nor File > Project Structure > Modules > Sources > Exclude.
What I did was: I clicked on the excluded folder with right-click of the mouse. In the menu which opened there is an option "Mark Directory as". I chose "Not Excluded".
A simple workflow is to create a directory in your project and exclude the entire directory.. For example, create a directory called, 'excluded'... add files to exclude... right click directory > mark directory as excluded... If you want to add or remove files from that directory reverse the process... cancel exclusion on the directory, get/put files... mark as excluded again.
To configure classes to be excluded from import open:
Editor / General node, then click Auto-Import.
This works for me. You can also find this in the documentation:
IntelliJ was still excluding a file after I removed it from the compiler exclude folder. It turns out I had also excluded it in File > Project Structure > Modules > Sources > Exclude files (at the bottom of the window).
Nothing to worry about. Simply follow this steps Mac/ windows
File > Settings >
Build, execution, deployment > Excludes
Select the file that you selected as exclude from compile (mistakenly)
Finally delete it and Press ok.
Now you can run the program/code again.
Congratulations!! Problem solved
I had the same problem of exclude things, and my solutions where:
Tuve el mismo problema de sacar sin querer cosas que no debía y mi soluciones fueron:
Case 1:
IntelliJ IDEA ->Preferences -> Build,Excecution, Deployment ->Build Tools (my case) -> Maven -> Maven ->IgnoredFiles (uncheck the relevant option )
Caso 1:
Me pasó lo mismo y mi solución fue ir (en Mac) a:
IntelliJ IDEA ->Preferences -> Build,Excecution, Deployment ->Build Tools (en mi caso) -> Maven -> IgnoredFiles (destildar la opción, en mi caso el file en cuestión
Case 2:
IntelliJ IDEA ->Preferences -> Build,Excecution, Deployment -> Compiler -> Excludes and select the relevant option -> minus or plus
Caso 2:
IntelliJ IDEA ->Preferences -> Build,Excecution, Deployment -> Compiler -> Excludes and select the relevant option -> clickear en el signo más o en menos según corresponda
Up-to-date in 2023:
Go to Editor > File Types > Ignored Files and Folders tab
Remove the file/folder pattern you want to include again.
Using CMake I am using a third party library, TinyThread++, it is a simple Thread library wrapper and only contains 1 source files and 2 header files.
In my project CMakeList.txt I added the following line:
add_library(TinyThread STATIC ${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/TinyThread/source/tinythread.cpp)
And then added a dependency to this library to the my executable this is working great.
I am trying to figure out how to copy or export the two header files to a common include directory I am using in my project.
${CMAKE_CURRENT_SOURCE_DIR}/../../include
What is the recommended way to do this?
If you simply want to "use" those headerfiles while compiling, you can use include_directories() like Naszta explains.
In case you really want to copy the files, you can use configure_file() or file( COPY ... ) (check the bottom of the section on the file() command).
I think you should do something like this:
SET(TINY_THREAD_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "TinyThread include path")
SET(TINY_THREAD_SOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/tinythread.cpp" CACHE FILEPATH "TinyThread source file")
...
INCLUDE_DIRECTORIES(${TINY_THREAD_INCLUDE_PATH})
ADD_LIBRARY(TinyThread STATIC ${TINY_THREAD_SOURCE_FILE})
This way you could reuse them later by their name. If you would like to hide them in normal mode:
MARK_AS_ADVANCED(TINY_THREAD_INCLUDE_PATH TINY_THREAD_SOURCE_FILE)