I'm using Play 2.3.2 for my application.
Even if I don't change a source file, something is always compiling when I run my tests or refresh my browser.
Exemple when an unknown file is compiling :
[info] Compiling 1 Java source to /my-app/target/scala-2.10/test-classes
How can I have more logs to see what files are compiled in order to see where the problem comes from ?
Thanks #LimbSoup for the solution.
Here is what you need to add in the build.sbt file :
logLevel in compile := Level.Debug
Related
I have an old project with all files and folders and its jar file (xyz_2.11-1.0.jar) was at target\scala-2.11\ folder, and I removed it to replace by a new fresh one... I do and redo with similar final results:
cd xyz
sbt: say "[info] Loading settings from assembly.sbt ..." and seems all ok.
compile: say "[success] Total time: 11 s, completed"
package: say "[success] Total time: 6 s, completed"
But target\scala-2.11\ folder is empty, no new jar file!
How to compile and generate the jar file?
It might be a good idea to check the behavior using the latest stable version sbt 1.4.7 as opposed to sbt 1.1.5 from 2018. Because it seems like you missed the fix by one patch version.
This issue was reported in 2018 as https://github.com/sbt/sbt/issues/4118, and was later fixed by dadarakt also in 2018 as https://github.com/sbt/sbt/pull/4161, which released in sbt 1.1.6.
When I changed the source code (anything at /src/main) the procedure saved the jar file.
So, the SBT v1.1.5 logic is: not save jar when no changes... It is not a bug, but perhaps need a new issue for next SBT versions:
If there are no jar file (deleted) it need to save one.
To change the "verbose level" I used logLevel := Level.Info and logLevel := Level.Debug.
About jar file complete path, only the Debug "verbose level" shows it,
[debug] No changes
[debug] Jar uptodate: C:\Users\myUser\etc\xyz\target\scala-2.11\xyz_2.11-1.0.jar
But dir C:\Users\myUser\etc\xyz\target\scala-2.11\xyz_2.11-1.0.jar say "file not found". Only after source code changes it saved.
I am unable to generate the code coverage data when the the workspace is built with custom XCODE_CONFIGURATION_BUILD_DIR.
We run the xcodebuild commands to build the workspace with a XCODE_CONFIGURATION_BUILD_DIR, so that multiple jenkins CI jobs won't overwrite the build output of other jobs which are also running concurrently.
When we run the tests for a build generated this way and try to get the code coverage report, the command fails with the below error.
jenkins$ xcrun xccov view *.xccovreport
Errors:
Error Domain=IDEFoundationErrorDomain Code=14 "Failed to merge raw profiles in directory /Users/jenkins/Library/Developer/Xcode/DerivedData/XXXXXX-buggtqumttnpjvejnbfhulhqcvno/Build/ProfileData/bff950eda0f75b2dbadb3ce08510474b4667ac82 to destination /Users/jenkins/Library/Developer/Xcode/DerivedData/XXXXXX-buggtqumttnpjvejnbfhulhqcvno/Build/ProfileData/bff950eda0f75b2dbadb3ce08510474b4667ac82/Coverage.profdata: No profile data files were written to '/Users/jenkins/Library/Developer/Xcode/DerivedData/XXXXXX-buggtqumttnpjvejnbfhulhqcvno/Build/ProfileData/bff950eda0f75b2dbadb3ce08510474b4667ac82'" UserInfo={NSLocalizedDescription=Failed to merge raw profiles in directory /Users/jenkins/Library/Developer/Xcode/DerivedData/XXXXXX-buggtqumttnpjvejnbfhulhqcvno/Build/ProfileData/bff950eda0f75b2dbadb3ce08510474b4667ac82 to destination /Users/jenkins/Library/Developer/Xcode/DerivedData/XXXXXX-buggtqumttnpjvejnbfhulhqcvno/Build/ProfileData/bff950eda0f75b2dbadb3ce08510474b4667ac82/Coverage.profdata: No profile data files were written to '/Users/jenkins/Library/Developer/Xcode/DerivedData/XXXXXX-buggtqumttnpjvejnbfhulhqcvno/Build/ProfileData/bff950eda0f75b2dbadb3ce08510474b4667ac82'}
Version/Build:
Version 10.1 (10B61)
Found this thread on Github
The issue was: generating coverage for a Static Library fails, but not for a Dynamic Library.
So check if it works, changing on pbxproj:
- MACH_O_TYPE = staticlib;
+ MACH_O_TYPE = mh_dylib;
And it really generated coverage successfully on my sample framework.
The solution which worked for me was, I have changed the Mach-O-Type from Executable to Static Library.
With the option Dynamic Library also, the coverage report was generating but the build was failing.
Another option was to set the test target as Static Library and Main Target as Executable. Build Succeeded and able to see the coverage for multiple targets.
Xcode Version : 13.4
After updating to Xcode 10 there are some issues with initial project configurations. The steps look like this:
Generating some files using Sourcery
Linting with SwiftLint
Build
And configuration works like this:
And this was working fine in Xcode 9, but apparently, it's not working under Xcode 10 build system. The issue is if I download repository (.generated files are not a part of the repository). And hit build it will show me results like:
...
Using configuration file at '.sourcery.yml'
Scanning sources...
Found 239 types.
Loading templates...
Loaded 9 templates.
Generating code...
Finished.
Processing time 0.491948962211609 seconds
...
So sourcery works ok, then linting:
Linting 'FromResponse.generated.swift' (1/186)
Works fine as well as a process, but in the end, build will fail with:
error: Build input files cannot be found:
'/path/Generated/FromResponse.generated.swift',
...
So it's strange since a files are physically there and according to build settings file should be compiled later than generating them. How should I approach sourcery in build process then?
We are able to "fix" this in a similar way as this Github issue:
https://github.com/mac-cain13/R.swift/issues/438#issuecomment-416982928
We have to add each of the generated files by Sourcery to the output folder and it will get picked up by the Xcode correctly.
This relates to changes in the New Xcode Build System that has been enabled by default in Xcode 10. If a build phase creates files which are needed as an input to a later build phase then it needs to specify them explicitly in the Output Files or Output File List.
In your example the Sourcery build phase is generating Swift source file(s) which are needed as input to the Compile Sources phase.
However, the issue at this point is that after you specify the output files for Sourcery, the build phase doesn't re-run every time as it sees the output file is already there. So far I haven't worked out a useable solution to this part, beyond running tools like Sourcery and SwiftGen manually or keeping the generated files in Git so that they are always present.
I was having a similar problem with a buildphase calling mogenerator to build my data model classes. The approach given by #Yuchen should work.
#Andrew: To force always (re-)running this build phase, I add the line
touch .alwaysRun
as the last line in the shell command to run and mark the build phase "Input Files" to have $(SRCROOT)/.alwaysRun. That seems to do the trick.
I am trying to learn jdb. I have a maven project. I tried debugging it with jdb when I use the list command I am not able to see any source code. I get this message:
main[1] list
Source file not found: App.java
So how should I compile a project with maven so that it can latter be debugged with jdb and I can see the source code?
Looks like this has nothing to do with maven. One of the options jdb takes is the sourcepath and it is over here you specify the path(s) it will search for the source code.
We have our own GCC based compiler. We use eclipse in order to develop .c files using our compiler – after hitting the build button eclipse manages to run our ‘make’ file and the build operation succeeds.
We’re trying to configure the eclipse project such that it will use this compiler in order to show the compilation errors as red underline marks during the code-writing stage.
In order to do so, we add the following configurations:
Project properties > C/C++ Build>Tool chain editor > current toolchain: “Cross GCC”, current builder: “CDT internal builder”
Project properties > C/C++ Build>Settings>Tool Settings>Cross Settings> - here I set the prefix and the path of my GCC compiler.
Project properties > C/C++ General > Preprocessor include path, Macro etc. > providers > check: “CDT Cross Build Output Parser” and inside check “Allocate console in the console view”.
After doing that we get the following error in the console view:
i486-elf-g++ -E -P -v -dD
C:/Users/workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C
Cannot run program "i486-elf-g++": Launching failed Error: Program
"i486-elf-g++" not found in PATH
It looks like eclipse is trying to compile a file named “spec.C”, in the plugin directory. We tried to look for that file and we only found an auto-generated file called “spec.c” (lower case .c) that is empty.
Our compiler executable name is “i486-elf-gcc”.
What additional steps need to be done?
Note that running the make file using the “build” button completes without errors or warnings.
Thanks
This is not related to the spec.c. It seems that the path of the i486-elf-gcc is not in the PATH variable. You can add the path the PATH-varaible in the "Environment" -tab