Unable to resolve module "empty-module.js" error - ios

For building an iOS React Native app, I am able to successfully run the following command in a MacOS terminal:
xcodebuild archive -workspace MyProject.xcworkspace -derivedDataPath build -scheme MyProject -archivePath $PWD/build-artifacts/MyProject.xcarchive -configuration Release CODE_SIGN_STYLE='Automatic' BITCODE_GENERATION_MODE='bitcode'
However when invoking the same command via a Jenkins "Execute shell" step, it results in the following error:
error Unable to resolve module /Users/mike/git/my-project/node_modules/react-native/node_modules/metro-runtime/src/modules/empty-module.js from /Users/mike/git/my-project/_:
None of these files exist:
* ../my-project/node_modules/react-native/node_modules/metro-runtime/src/modules/empty-module.js(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
* ../my-project/node_modules/react-native/node_modules/metro-runtime/src/modules/empty-module.js/index(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
at ModuleResolver.resolveDependency (/Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:136:15)
at ModuleResolver._getEmptyModule (/Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:49:26)
at ModuleResolver._getFileResolvedModule (/Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:195:21)
at ModuleResolver.resolveDependency (/Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:132:19)
at DependencyGraph.resolveDependency (/Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
at Object.resolve (/Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/lib/transformHelpers.js:129:24)
at resolve (/Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
at /Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
at Array.reduce (<anonymous>)
at resolveDependencies (/Users/mike/git/my-project/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
I have ensured that the PATH is set consistently between the system and Jenkins for build tools like node and npm. I would appreciate any input from anyone who has experienced
similar issues.

Related

How to use Fastlane with a CMake generated XCode project with dependency on WebP?

I have a project written in C++ where CMake is used to generate the build system for various platforms including iOS. The project has a dependency on WebP. You can find an example project on GitHub here that can be used to reproduce things & I've included the relevant source files at the end of this post for completeness.
The Xcode build system for iOS is generated using CMake as follows:
cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=third_party/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=15.0 -DENABLE_BITCODE=0 -S . -B cmake-build-release
We can now attempt to build/archive the app using Fastlane with the command from within the generated cmake-build-release directory:
bundle exec fastlane ios beta
However this fails due to being unable to locate various webp object files (that based on console output it appears to have previously successfully compiled):
...
▸ Compiling buffer_dec.c
▸ Compiling alpha_dec.c
▸ Building library libwebpdsp.a
...
** ARCHIVE FAILED **
▸ The following build commands failed:
▸ Libtool /Users/dbotha/Library/Developer/Xcode/DerivedData/CMakeFastlaneWebpTest-dlwvukebfiwjqvaqiepshuxqklhh/ArchiveIntermediates/CMakeFastlaneWebpTest/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libwebpdecoder.a normal (in target 'webpdecoder' from project 'CMakeFastlaneWebpTest')
▸ (1 failure)
▸ ❌ error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Users/dbotha/CLionProjects/CMakeFastlaneWebpTest/cmake-build-release/third_party/libwebp/CMakeFastlaneWebpTest.build/Release-iphoneos/webpdecode.build/Objects-normal/arm64/alpha_dec.o (No such file or directory)
▸ ❌ error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Users/dbotha/CLionProjects/CMakeFastlaneWebpTest/cmake-build-release/third_party/libwebp/CMakeFastlaneWebpTest.build/Release-iphoneos/webpdecode.build/Objects-normal/arm64/buffer_dec.o (No such file or directory)
...
Internally Fastlane attempted to build/archive the project with the following command:
xcodebuild -scheme CMakeFastlaneWebpTest -project ./CMakeFastlaneWebpTest.xcodeproj -configuration Release -destination 'generic/platform=iOS' -archivePath ./out.xcarchive archive
Interestingly an archive can be successfully generated if I use the following xcodebuild command (note how -target flag is used instead of -scheme):
xcodebuild -project CMakeFastlaneWebpTest.xcodeproj archive -target CMakeFastlaneWebpTest -configuration Release
After this successful attempt bundle exec fastlane ios beta will now also succeed as the compiled object files are where it expected them to be.
Now I'd happily workaround this issue using my xcodebuild + -target flag approach and then use the fastlane command to push to Testflight, etc. but the real project (not this toy example) takes a very long time to build so building it twice is really wasteful from a cost point of view on CI platforms.
Does anyone have any idea what's going on here & how I can successfully build things in the first instance using fastlane without my own explicit call to xcodebuild first? Or alternatively how can I have Fastlane use the successfully built objects from my workaround so it doesn't need to rebuild the entire project from scratch?
CMakeLists.txt
cmake_minimum_required(VERSION 3.23)
project(CMakeFastlaneWebpTest)
set(CMAKE_CXX_STANDARD 14)
add_executable(CMakeFastlaneWebpTest src/main.cpp)
# Skip building of unused webp tools which fail for me under ios:
set(WEBP_BUILD_ANIM_UTILS OFF)
set(WEBP_BUILD_CWEBP OFF)
set(WEBP_BUILD_DWEBP OFF)
set(WEBP_BUILD_GIF2WEBP OFF)
set(WEBP_BUILD_IMG2WEBP OFF)
set(WEBP_BUILD_VWEBP OFF)
set(WEBP_BUILD_WEBPINFO OFF)
set(WEBP_BUILD_WEBPMUX OFF)
set(WEBP_BUILD_EXTRAS OFF)
set(WEBP_BUILD_WEBP_JS OFF)
add_subdirectory(third_party/libwebp EXCLUDE_FROM_ALL)
target_link_libraries(CMakeFastlaneWebpTest PRIVATE webpdecoder webpdemux)
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/third_party/libwebp/src)
configure_file(${CMAKE_SOURCE_DIR}/fastlane/Appfile ${CMAKE_BINARY_DIR}/fastlane/Appfile COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/fastlane/Fastfile ${CMAKE_BINARY_DIR}/fastlane/Fastfile COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/Gemfile ${CMAKE_BINARY_DIR}/Gemfile COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/Gemfile.lock ${CMAKE_BINARY_DIR}/Gemfile.lock COPYONLY)
set_target_properties(CMakeFastlaneWebpTest PROPERTIES
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/src/iOS-Info.plist.in
MACOSX_BUNDLE_GUI_IDENTIFIER com.dbotha.CMakeFastlaneWebpTest
MACOSX_BUNDLE_BUNDLE_NAME CMakeFastlaneWebpTest
MACOSX_BUNDLE_BUNDLE_VERSION "0.1"
MACOSX_BUNDLE_SHORT_VERSION_STRING "0.1"
)
set_xcode_property(CMakeFastlaneWebpTest PRODUCT_BUNDLE_IDENTIFIER "com.dbotha.CMakeFastlaneWebpTest" All)
set_xcode_property(CMakeFastlaneWebpTest CODE_SIGN_IDENTITY "iPhone Developer" All)
set_xcode_property(CMakeFastlaneWebpTest DEVELOPMENT_TEAM "GFP63373B2" All)
fastlane/Appfile
app_identifier("com.dbotha.CMakeFastlaneWebpTest") # The bundle identifier of your app
apple_id("REPLACE_ME") # Your Apple Developer Portal username
itc_team_id("REPLACE_ME") # App Store Connect Team ID
team_id("REPLACE_ME") # Developer Portal Team ID
fastlane/Fastfile
default_platform(:ios)
platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
build_app(scheme: "CMakeFastlaneWebpTest", configuration: "Release")
upload_to_testflight
end
end
src/main.cpp
#include <iostream>
#include <webp/demux.h>
int main() {
WebPAnimDecoderOptions decOptions;
(void)decOptions;
std::cout << "Hello, World!" << std::endl;
return 0;
}
I'm not an expert in this topic but according to the documentation you should provide workspace to build your scheme.
To build an Xcode workspace, you must pass both the -workspace and
-scheme options to define the build. The parameters of the scheme will
control which targets are built and how they are built, although you may
pass other options to xcodebuild to override some parameters of the
scheme.
Scheme controls what target will be build, and guessing by your example, since you do not provide a workspace, it gets lost in the process.
The scheme is not lost anymore if you build the target manually. Since it is already build the scheme does not have to do a thing.
My proposals:
Option 1: Try adding workspace to build_app parameters in Fastfile.
Option 2: Don't bother with building scheme just use target in the
build_app parameters in Fastfile like so: build_app(target: "CMakeFastlaneWebpTest", configuration: "Release")

Someone got convert coverage in new version xcode12 - SonarQube

I'm trying to perform the conversion for SonarQube to interpret coverage and I get this error:
Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load result bundle" UserInfo={NSLocalizedDescription=Failed to load result bundle, NSUnderlyingError=0x7fdaa840a8d0 {Error Domain=IDEFoundation.ResultBundleError Code=0 "This version of Xcode does not support opening result bundles created with versions of Xcode and xcodebuild using the v1 API."}}
The operation couldn’t be completed. (cococoLibrary.Bash.Error error 0.)
The solution was to update slather to version 2.5 and also generate coverage in the sonarqube generic mode. Follow the steps for successful reproduction:
Build
xcodebuild -workspace 'YourProject.xcworkspace' -scheme DEV -derivedDataPath Build/ -enableCodeCoverage YES clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 8,OS=14.0'
Slather generate sonarqube generic xml
slather coverage --jenkins --sonarqube-xml --build-directory ./Build --output-directory ./sonar-reports --scheme DEV --workspace YourProject.xcworkspace
Run analise Sonarqube
sonar-scanner -Dsonar.sources=. -Dsonar.coverageReportPaths=./sonar-reports/sonarqube-generic-coverage.xml -Dproject.settings=sonar-project.properties -Dsonar.qualitygate.wait=true
This page gives steps to generate code coverage for various Xcode versions. there are primarily 3 steps as shown in the description.
Build project
Create code coverage report
Import code coverage report
https://github.com/SonarSource/sonar-scanning-examples/tree/master/swift-coverage
This is a popular page to integrate CI with Sonar as well, its from SonarSource.

How to build a react native project with cocoapods and workspace?

Before I install Pods and add a workspace to my react native project I build my project successfully using this command:
xcodebuild -scheme [SchemeName] archive -archivePath ./build/[AppName].xcarchive -allowProvisioningUpdates
I installed RN Firebase using CocoaPods and it need a xcworkspace to manage packages. According this I added the workspace option to allow the xcodebuild to find Pods:
-workspace [AppName].xcworkspace
After adding this option, the build failed because it don't find main.jsbundle.
Loading dependency graph, done.
SHA-1 for file /Users/nicolas/development/git/availpro.mobile/index.js is not computed
ReferenceError: SHA-1 for file /Users/nicolas/development/git/availpro.mobile/index.js is not computed
at DependencyGraph.getSha1 (/Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/node-haste/DependencyGraph.js:201:13)
at /Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:164:26
at Generator.next (<anonymous>)
at step (/Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:31:30)
at /Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:50:14
at new Promise (<anonymous>)
at /Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:28:12
at Transformer.transformFile (/Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:188:7)
at /Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/Bundler.js:78:34
at Generator.next (<anonymous>)
+ [[ false != true ]]
+ [[ ! -f /Users/nicolas/Library/Developer/Xcode/DerivedData/AvailproMobile-gewuoxculvshvhehwwobcbkhdzba/Build/Intermediates.noindex/ArchiveIntermediates/AvailproMobile-staging/BuildProductsPath/Release-iphoneos/AvailproMobile.app/main.jsbundle ]]
+ echo 'error: File /Users/nicolas/Library/Developer/Xcode/DerivedData/AvailproMobile-gewuoxculvshvhehwwobcbkhdzba/Build/Intermediates.noindex/ArchiveIntermediates/AvailproMobile-staging/BuildProductsPath/Release-iphoneos/AvailproMobile.app/main.jsbundle does not exist. This must be a bug with'
error: File /Users/nicolas/Library/Developer/Xcode/DerivedData/AvailproMobile-gewuoxculvshvhehwwobcbkhdzba/Build/Intermediates.noindex/ArchiveIntermediates/AvailproMobile-staging/BuildProductsPath/Release-iphoneos/AvailproMobile.app/main.jsbundle does not exist. This must be a bug with
+ echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
React Native, please report it here: https://github.com/facebook/react-native/issues
+ exit 2
To quick fix the issue I generate the main.jsbundle manually before the xcodebuild:
react-native bundle --entry-file='index.js' --bundle-output='./ios/[AppName]/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
This fix seems to me a hack than a real solution.
Anyone can tell me why building the project using a .xcworkspace don't generate the main.jsbundle while building a .xcodeproj generate it ?
Thanks!

Can not make script 'run-sonar-swift' works

I am trying to run sonar swift.
I have already sonarQube with the plugin and I can access it locally using this url http://localhost:9000 . I have installed all prerequisites that you can find here :
https://github.com/Backelite/sonar-swift
But I can't figure out what is this error when i launch run-sonar-swift.sh.
If anyone can bring me the light I would be very grateful.
Here the logs when I run in terminal command ./run-sonar-swift.sh -v :
MacBook-Air:streamus-phoenix-ios oboujaouane$ ./run-sonar-swift.sh -v
Running run-sonar-swift.sh...
Project count is [1]
Xcode project file is: Streamus.xcodeproj
Xcode workspace file is: Streamus.xcworkspace
Xcode application scheme is: Streamus Alpha
Destination simulator is: platform=iOS Simulator,name=iPhone 6,OS=11.3
Excluded paths from coverage are: .Tests.
Creating directory sonar-reports/
Running tests
+ xcodebuild clean build test -workspace Streamus.xcworkspace -scheme 'Streamus Alpha' -configuration Debug -enableCodeCoverage YES -destination 'platform=iOS Simulator,name=iPhone 6,OS=11.3' -destination-timeout 60
2018-05-12 10:34:14.031 xcodebuild[32149:775290] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusUITests-87E838E0-4F8F-4C19-B2AC-C2C0A274E8EC/Session-StreamusUITests-2018-05-12_103414-jhm3wz.log
2018-05-12 10:34:14.032 xcodebuild[32149:769805] [MT] IDETestOperationsObserverDebug: (98FB295E-FE60-46AA-8589-015B0DD2E617) Beginning test session StreamusUITests-98FB295E-FE60-46AA-8589-015B0DD2E617 at 2018-05-12 10:34:14.031 with Xcode 9E145 on target {
SimDevice: iPhone 6 (672DE879-E48B-45DA-BFD9-D0412F51A706, iOS 11.3, Booted)
} (11.3 (15E217))
2018-05-12 10:34:14.061 xcodebuild[32149:769805] [MT] IDETestOperationsObserverDebug: (458F86F6-1492-40F1-9F72-A88FC23BD985) Beginning test session StreamusTests-458F86F6-1492-40F1-9F72-A88FC23BD985 at
2018-05-12 10:34:14.061 with Xcode 9E145 on target {
SimDevice: iPhone 6 (672DE879-E48B-45DA-BFD9-D0412F51A706, iOS 11.3, Booted)
} (11.3 (15E217))
2018-05-12 10:34:14.061 xcodebuild[32149:770075] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusTests-4F203461-1372-49B7-A806-F130F168079E/Session-StreamusTests-2018-05-12_103414-MfIreE.log
2018-05-12 10:34:30.016 xcodebuild[32149:769805]
Error Domain=IDETestOperationsObserverErrorDomain Code=14 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusUITests-87E838E0-4F8F-4C19-B2AC-C2C0A274E8EC/Session-StreamusUITests-2018-05-12_103414-jhm3wz.log"
UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusUITests-87E838E0-4F8F-4C19-B2AC-C2C0A274E8EC/Session-StreamusUITests-2018-05-12_103414-jhm3wz.log}
2018-05-12 10:34:30.016 xcodebuild[32149:769805] Error Domain=IDETestOperationsObserverErrorDomain Code=14 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusTests-4F203461-1372-49B7-A806-F130F168079E/Session-StreamusTests-2018-05-12_103414-MfIreE.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/9v/vdbbf4j96hxgcxmtpntznytr0000gn/T/com.apple.dt.XCTest/IDETestRunSession-9A7EF764-6391-4C7D-9F34-066A9DFEC5E9/StreamusTests-4F203461-1372-49B7-A806-F130F168079E/Session-StreamusTests-2018-05-12_103414-MfIreE.log}
Testing failed:
Linker command failed with exit code 1 (use -v to see invocation)
** TEST FAILED **
The following build commands failed:
Ld /Users/oboujaouane/Library/Developer/Xcode/DerivedData/Streamus-gwtdwpbaxrfgafdtejzjtpxyhhhq/Build/Intermediates.noindex/Streamus.build/Alpha-iphonesimulator/StreamusTests.build/Objects-normal/x86_64/StreamusTests normal x86_64
Ld /Users/oboujaouane/Library/Developer/Xcode/DerivedData/Streamus-gwtdwpbaxrfgafdtejzjtpxyhhhq/Build/Intermediates.noindex/Streamus.build/Alpha-iphonesimulator/StreamusTests.build/Objects-normal/i386/StreamusTests normal i386
(2 failures)
returnValue=65
set +x
ERROR - Command 'xcodebuild clean build test -workspace Streamus.xcworkspace -scheme Streamus Alpha -configuration Debug -enableCodeCoverage YES -destination platform=iOS Simulator,name=iPhone 6,OS=11.3 -destination-timeout 60' failed with error code: 65
In advance thank you,
It seems that error was due to provisioning profile. When I added my Provisioning Profile and try it again the problem was resolved.
Then I had another problem with MessageKit:“Segmentation fault: 11”
It was a CocoaPods Podfile config issue.
So I had to switch compilation mode for Debug from "Single File" to "Whole Module” by click on Pods in Xcode project navigator then select MessageKit in targets of pods then Builds settings tab then in searcher tap ‘compilation mode’ and switch “Single File” to “Whole Module” and re-run script run-sonar-swift.sh

⚠️ each time you make a pod install / update or something that can change pods you have to switch compilation mode for Debug from "Single File" to "Whole Module” for the pod which give you an error when you launch run-sonar.swift.sh with -v for verbose.
After that it was not yet the end of my problems! In fact I had a last problem which was an error with SwipeCellKit pod:
“No such module SwipeCellKit”.
To resolve this problem follow instructions given here https://stackoverflow.com/a/37732248/6188918
Then I tried again and the rest of the script started (SwiftLint, Tailor & Lizard) and I thought this time it was finally good but an error occurred once again a new error message at the end of the script concerning Lizard which was:
ERROR: Error during SonarQube Scanner execution
ERROR: File
MyprojectName/Domains/Repositories/Local/cacheManager.swift can't be
indexed twice. Please check that inclusion/exclusion patterns produce
disjoint sets for main and test files
ERROR: Re-run SonarQube Scanner using the -X switch to enable full
debug logging.
To resolve this inclusion/exclusion I followed the answer given here:
https://stackoverflow.com/a/40150551/6188918
by adding these to line in sonar-project.properties file below sonar.swift.excludedPathsFromCoverage line:
sonar.test.inclusions=**/*Test*/**
sonar.exclusions=**/*Test*/**
I tried again but with parameter -notailor(run script and skip Tailor):
./run-sonar-swift.sh -notailor -v
just to save a little time because tailor take time
And after launch the script... Boom a new error... But it was a known issue:
Error: Caused by: org.sonar.api.measures.PersistenceMode
And the issue is explained here https://github.com/Backelite/sonar-swift/issues/118
So I downloaded this .jar file “backelite-sonar-swift-plugin-0.4-sonar-7-quick-fix.jar” found here https://github.com/Hugal31/sonar-swift/releases/tag/0.4-sonar-7-quick-fix and replace it in plugins of my local SonarQube and try again.
…and this time after an umpteenth launch I finally saw the light 🤪💡
Hope this answer will help and if you have a question don’t hesitate.


Good luck & have fun :)
PS: You’ll find here some options to run script with parameters:
./run-sonar-swift.sh -noswiftlint -v (run script with verbose option and skip SwiftLint)
./run-sonar-swift.sh -notailor -v (run script with verbose option and skip Tailor)
./run-sonar-swift.sh -nounittests -v (if your project does not have scheme configured to be tested launch with this parameter)
If you want more info check in run-sonar-swift.sh script and check around lines 125 ## COMMAND LINE OPTIONS
PS2: I have also opened an issue in sonar-swift GitHub if it can help: https://github.com/Backelite/sonar-swift/issues/138
I had an extra issue with oclint: oclint: Not enough positional command line arguments specified!. So I had to modify the run-sonar-swift.sh script a little bit in order to get it working: https://gist.github.com/Edudjr/79a2379842357c33709aecf040d9ae77#file-run-sonar-swift-sh
And this is a model of my sonar-project.properties: https://gist.github.com/Edudjr/db51907068ea76b116d11d9a9b13f05f#file-sonar-project-properties

build alljoyn_darwin in Xcode 6.1.1 and get a No SConstruct file found error

Recently I am doing some AllJoyn development on iOS and OS X. When I run xcodebuild for alljoyn_darwin.xcodeproj using command line as below:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project alljoyn_darwin.xcodeproj -scheme alljoyn_core_ios -sdk iphoneos -configuration Debug PLATFORM_NAME=iphoneos
I got an error like this:
export variant=normal
/opt/local/bin/scons -u OS=darwin CPU=arm BR=on BINDINGS=cpp SERVICES= WS=off VARIANT=Debug --
scons: *** No SConstruct file found.
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.4/SCons/Script/Main.py", line 920, in _main
Command /opt/local/bin/scons failed with exit code 2
** BUILD FAILED **
The following build commands failed:
ExternalBuildToolExecution alljoyn_core_ios
(1 failure)
I really have no idea why I got this, I followed all the instruction in the official site--Build From Source and I am sure I set the correct OPENSSL_ROOT path. I installed scons using Macport and it was installed correctly. I tried double-click the alljoyn_darwin.xcodeproj from finder but I got the same error.
scons: *** No SConstruct file found.
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.4/SCons/Script/Main.py", line 920, in _main
Command /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/scons-2.3.4 failed with exit code 2
So I am stuck here. But the thing is I can successfully run AllChatz sample in sdk_14.12 for iOS in iphonesimulator for iPhone6. openssl version is 1.0.2 and I tried build both for alljoyn sdks 14.06 and 14.12. same error happened. I don't know if this is related. Anyone can help here? Many thanks.
The problem is that scons cant find the root-level SConstruct script, which probably doesnt help much as you can see that in the error :)
When you use the "-u", that tells scons to look up the directory structure for the root-level SConstruct script.
SCons must be executed from within the project directory structure. Look for the root-level SConstruct, and make sure you're executing scons from within the project directory structure.

Resources