Prettier: optional chaining support - prettier

Vs code > OUTPUT > Prettier
2/23/2020, 12:10:36 PM:
-----------------------
Expression expected. (/Users/yanivper/dev/test/test.ts:2:23)
1 | function test(obj) {
2 | return obj.a?.b;
^
In a new project:
npm i typescript
VScode use Workstation Version 3.8.2 (shown in the left-bottom bar TypeScript 3.8.2 )
Prettier v 2.2.2

In my case I resolve by update prettier from 1.18.2 to 2.0.5.
If someone here is using JetBrains based IDE, please check your prettier settings in IDE, make sure the "Prettier package" is set to right path but not older version path in your global package.

Related

Qt iOS application build fails unless added and disabled "DisableBuildSystemDeprecationDiagnostic" in xcsettings file

I've an iPadOS application build using Qt5 (version 5.12.11), I'm able to generate an IPA only when the following lines are added to my build script.
```
# adds "DisableBuildSystemDeprecationDiagnostic" to xcsettings file, and then toggle it true.
/usr/libexec/PlistBuddy -c "Add :DisableBuildSystemDeprecationDiagnostic bool" Focus.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
/usr/libexec/PlistBuddy -c "Set :DisableBuildSystemDeprecationDiagnostic true" Focus.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
```
is there new build system that takes care of this? since I'm not sure untill when I can use depreciated build system
Build Details:
Qt version: 5.12.11
qmake version: 3.1
MacOs version: 12.6 (Monterey, M1 2020)
Xcode version: 14.0.1 (14A400)
xcodebuild version: 14.0.1 (14A400)
Thanks
Ronak Jain.

Cake Addins install fail error during build

I am using net 4.8 framework. and cake version 0.38.2.
During build in Teamcity, it has to install addins cake.npm, cake.filehelpers. But following error happens
Could not find any assemblies compatible with .NETFramework,Version=v4.6.1.
Error: Failed to install addin 'Cake.Npm'.
When I use cake.npm version as 0.17.0 for cake 0.38.2, it generates two folders - cake.npm and cake.npm0.17.0. Only cake npm0.17.0 is required, because it has netstandard2.0 which can make build successful. But the other folder makes it fail
As discussed in https://github.com/cake-contrib/Cake.Npm/issues/140 Cake.Npm is not the culprit, here.
There is an additional (#load) reference in the project to Cake.Sitecore in version 1.0.3 which in contents/scripts/tasks.restore.cake contains the line
#addin "Cake.Npm"
This - without an explicit version being set - will always default to the newest version (currently 2.0.0, which is incompatible with Cake 0.38.2).
The current version of Cake.Sitecore (1.0.27) has that problem fixed.

How to accept android licenses after installing Tools for Cordova using Visual Studio 2017

I installed Visual Studio 2017 with the "Mobile development with JavaScript" option and "Android SDK setup" selected.
When I check Tools->Options->Tools for Apache Cordova->Environment Variable Overrides I can see that ANDROID_HOME has been set to "C:\ProgramData\Microsoft\AndroidSDK\25"
When I try to build my project I get an error:
cordova-build error : > You have not accepted the license agreements
of the following SDK components: cordova-build error : [Android SDK
Platform 25].
I open a Windows command prompt and go to the directory containing the sdkmanager:
cd C:\ProgramData\Microsoft\AndroidSDK\25\tools\bin
I try sdkmanager --licenses but that results in
Error: Unknown argument --licenses
So I try sdkmanager --update and that results in
Warning: An error occurred during installation: Failed to move away or
delete existing target file:
C:\ProgramData\Microsoft\AndroidSDK\25\tools Move it away manually and
try again.
So I move up to the folder above the tools folder and rename it:
ren tools tools.old
then try the update again:
tools.old\bin\sdkmanager --update
this gave me a warning:
Warning: Observed package id 'tools' in inconsistent location
'C:\ProgramData\Microsoft\AndroidSDK\25\tools.old' (Expected
'C:\ProgramData\Microsoft\AndroidSDK\25\tools')
But after a lengthy wait the command reported that it was done and I could see that there was a new "tools" folder.
I tried to build my project again. Now my error is:
Could not find gradle wrapper within Android SDK. Might need to update
your Android SDK.
Looked here:
C:\ProgramData\Microsoft\AndroidSDK\25\tools\templates\gradle\wrapper
References:
https://stackoverflow.com/a/47305199/150342
https://developer.android.com/studio/command-line/sdkmanager.html
You have not accepted the license agreements of the following SDK components

ServiceMix 7.x : feature installs/starts but bundle dependency never starts

ServiceMix 7.0.1
Windows 7; Java 1.8.x
commons-io/commons-io/2.4/commons-io-2.4.jar (note: the jar is a bundle; does not need to be wrapped)
<features name="smx7-test" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<feature name="smx7-test" version="1.0.0-SNAPSHOT">
<bundle dependency="true" start="true">mvn:commons-io/commons-io/2.4</bundle>
</feature>
Something different in ServiceMix 7.x (7.0.1) that I am missing or I need to configure a standard feature or other?
The commons-io jar/bundle dependency in the features.xml (above) never starts after the feature is installed/started. This is not isolated to just the commons-io jar/bundle. I have the same issue with the antlr-runtime-4.7.jar and commons-beanutils.jar among others. I have just setup a small sample test-case to quickly deploy and test using commons-io.
I start with a pristine servicemix 7.0.1 install.
I place the features.xml file (above) in the system repo: system/smx7/smx7-test/1.0.0-SNAPSHOT/smx7-test-1.0.0-SNAPSHOT-features.xml
I place the commons-io-2.4 jar in the system repo: system/commons-io/commons-io/2.4/commons-io-2.4.jar
Start servicemix 7.0.1 (servicemix.bat). All good so-far.
The feature installs fine with the following commands:
feature:repo-add mvn:smx7/smx7-test/1.0.0-SNAPSHOT/xml/features
feature:install smx7-test
I can do a feature:list | grep smx7-test and the feature shows as installed and started.
karaf#root>feature:list | grep smx7-test
smx7-test | 1.0.0.SNAPSHOT | x | Started | smx7-test
BUT a bundle:list in the karaf console indicates the common-io bundle is not in the listing. If i duplicate all above in servicemix 6.x all works as expected. That is the commons-io bundle is listed and started.
If i try to deploy a business layer bundle in the 7.0.1 instance above, that wants to import a commons-io package/class the business layer bundle will never start (shows only as installed). The error in the servicemix.log is as expected since the commons-io bundle never started :
missing requirement [test [222](R 222.2)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.commons.io)(version>=1.4.0)(!(version>=2.0.0)))
Note: the commons-io-2.4 jar/bundle MANIFEST.MF Export-Package contents is/are backwards compatible hence the version parameters in the error above. I tried modifying my business layer bundle MANIFEST.MF to allow for the range indicated above and it had no impact.
Any ServiceMix 7 suggestions welcome!!

Xcode9 Realm Error - No viable overloaded ‘=’

I just install Xcode 9 and build my native iOS project. (Is written in swift)
The project was OK in Xcode 8 but now, I obtain this error:
No viable overloaded '='
In the file: Pods\Pods\Realm\object.cpp
Line 42 => m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm);
If you are using Cocoapods, open up the Podfile and set the RealmSwift version to 2.8.1 (or 2.8.3 as David mentioned above). Here is my Podfile for Swift 3.0 using Xcode 9:
target ‘<PROJECT>’ do
use_frameworks!
# Pods
...
pod 'RealmSwift', '2.8.1'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
Then, save the file and run:
pod install
If you're not setting a specific pod version (which I recommend), run the following command:
pod update RealmSwift
and it will automatically update to the most recent version (2.8.3).
Hope it helps to complement David's answer. Thanks!
The Realm team has worked on a new version allowing you to build your project with XCode 9.
Just update your Realm version to at least 2.8.1 (current version is 2.8.3)
https://github.com/realm/realm-cocoa/releases/tag/v2.8.1
The Realm release note of 2.8.1 clearly states :
Add support for building with Xcode 9 Beta 1.