List only first-party changed projects in an nx monorepo ignoring dependency graph - monorepo

In my Nx-powered monorepo, myLib is a dependency for projectA, projectB and projectC. The graph looks something like:
myLib
/ | \
A B C
If I make a change to myLib and run nx print-affected then I see projectA-C listed as expected.
But what if I make a change to myLib and projectB and I only want to know which projects were explicitly changed? How can I ask Nx to only print myLib, projectB, ignoring that projectA and projectC were also affected?

Related

Vala: using a library won't work: taglib, tag_c.h not found

So I am tinkering with making an app for elementary os that uses the taglib library. Currently I installed the library to '/usr/include/taglib/' but when I try to build my app with sudo ninja install it says that it can't find the 'tag_c.h' file in the compiled c code of my app. This 'tag_c.h' file can however be found in the above directory.
The important parts of my meson file look as follows:
dependencies = [
dependency('gio-unix-2.0', version: '>=2.20'),
dependency('granite'),
dependency('taglib_c')
]
...
executable(
meson.project_name(),
code_files,
dependencies: dependencies,
install: true
)
I get no errors building my app when I remove the lines of code that actually use the TagLib library:
TagLib.File f = new TagLib.File(path);
So maybe this means that it finds the vapi, but cannot find the c code for it?
First of all, how do I solve this problem?
Second of all, is this just a problem on my machine? How do I make sure that other people who install my app also install taglib by just meson building it and have it work right away?
elementary OS is based on Debian/Ubuntu so I think you need to install libtagc0-dev as well. That includes the relevant pkg-config file and C header to use the C interface of TagLib.

What is the difference between lib/src and /bin in dart?

I know that lib/ is where we put all our library files and /bin is where we put our entrypoint for our command-line app. I know both of them are public lib/ and bin but i'm unable to understand the convention of using lib/src which according to the official docs should contain: implementation code
lib/ is the directory that contains shareable code.
It can be shared
to other top-level directories like bin/, web/, example/, test/, tool/, ... in the same package
to other packages that have this package as a dependency.
lib/src by convention contains the private implementation of the public API exposed by lib/ or lib/xxx where xxx is not src.
bin is reserved for command line apps and contains the Dart entry point scripts to execute them (the files that contain main() {...}).
In pubspec.yaml you can define executables https://www.dartlang.org/tools/pub/pubspec#executables that allows you to run scripts from bin/ by just executing foo to have dart somePath/bin/foo.dart executed (using pub global activate my_package_with_foo).
See Pub Package Layout Conventions - Implementation files
The libraries inside lib are publicly visible: other packages are free to import them. But much of a package’s code is internal implementation libraries that should only be imported and used by the package itself. Those go inside a subdirectory of lib called src. You can create subdirectories in there if it helps you organize things.
You are free to import libraries that live in lib/src from within other Dart code in the same package (like other libraries in lib, scripts in bin, and tests) but you should never import from another package’s lib/src directory. Those files are not part of the package’s public API, and they might change in ways that could break your code.
When you use libraries from within your own package, even code in src, you can (and should) still use package: to import them.

Publish files to bin folder when source files are in a sub-folder with ClickOnce with WPF app

I have found numerous articles on StackOverflow and elsewhere stating that if you wanted to output your files to the bin folder using ClickOnce, you should set the
BuildAction: Content
CopyToOuputDirectory : Copy if newer
but some of my binaries are located in a Dependencies subfolder located in the root of my project and when I publish the content, they are being outputted to
<wpf app folder>\dependencies instead of being in the <wpf app folder> causing my app to not function properly.
Any suggestions on how I can change this to force ClickOnce to output specific files to <wpf app folder>\ irrespective of where the Source files are located.
I eventually found a work-around which I don't like but I need to move on. To circumvent this problem I added the required libraries to the root of my project as links and still set the BuildAction to Content and CopyToOutputDirectory to Copy if newer.
I thought I'd explain it with an example as it may make a bit more sense.
Project Path: C:\Work\MyApp and it contains the following sub-folders:
D:\Work\MyApp\MyApp.csproj
D:\Work\MyApp\MyApp.xaml
...
D:\Work\MyApp\Bin\Debug
D:\Work\MyApp\Bin\Release
D:\Work\MyApp\Bin\Release\MyApp.exe
D:\Work\MyApp\Depedencies\LibA.dll
D:\Work\MyApp\Depedencies\LibB.dll
etc...
The libraries are third-party tools and are actually contained in their own folder:
D:\Tools\MyThirdPartyLib\Distributation\LibA.dll
D:\Tools\MyThirdPartyLib\Distributation\LibB.dll
By having the libraries in D:\Work\MyApp\Dependencies did not work as ClickOnce would install the app in:
C:\Users\\AppData\Local\Apps\2.0...\MyApp.exe
and it installed the files located in the Dependencies sub-folder in:
C:\Users\\AppData\Local\Apps\2.0...\Dependencies\LibA.dll
C:\Users\\AppData\Local\Apps\2.0...\Dependencies\LibB.dll
Which caused my app not to work.
To get around it, I ended up adding LibA.dll and LibB.dll to the root of my project as "Linked files" and set their BuildAction and CopyToOutputDirectory but not by pointing the linked files to
D:\Work\MyApp\Depedencies\LibA.dll
D:\Work\MyApp\Depedencies\LibB.dll
but instead pointing them:
D:\Tools\MyThirdPartyLib\Distributation\LibA.dll
D:\Tools\MyThirdPartyLib\Distributation\LibB.dll
And this seems to have done the trick. My only beef about it is that now I've got 10 odd files listed in the root of my project in visual studio which I don't like:
MyApp Solution
- MyApp Project
- MyApp.csproj
- MyApp.xaml
- ...
- LibA.dll
- LibB.dll
- ...
But it will have to do for now.
Hope it helps others!

cmake project build error, shared library with a dependency on another

I'm building a project that uses cmake.
The project uses three shared libraries .so files.
In the CMakeLists.txt file I've added the these lines which link the shared libraries to the executable.
project (lwm2mclient)
LINK_DIRECTORIES(/home/mraa-master-built/build/src)
LINK_DIRECTORIES(/home/libi2capi)
LINK_DIRECTORIES(/home/libtca6424a)
target_link_libraries (lwm2mclient libmraa.so m libi2capi.so libtca6424a.so)
However, one of the shared libraries libtca6424a.sodepends on libi2capi.so i.e. it uses methods that are defined in it.
So when I'm building the cmake project I get an error like this saying that the .so file cannot find the method which is defined in the other .so file libtca6424a.so.
Could somebody suggest a solution?
/../../lib/libtca6424a.so: undefined reference to `i2c_write_byte_data'
Please try
target_link_libraries (-Wl,--start-group lwm2mclient libmraa.so m libi2capi.so libtca6424a.so -Wl,--end-group)
or change the order of the libraries

external package from go get

I want use code.google.com/p/google-api-go-client/drive/v2 and other.
My app is structured like:
+-- MyApp
+---- app.yaml
+---- main.go
+---- src/
+------ ...external package...
My GOPATH is equal to "MyApp/src"
In my main.go I have `// +build !appengine"
I can't launch goapp serve, I get
2014/12/09 22:20:32 Can't find package "code.google.com/p/google-api-go-client/googleapi" in $GOPATH: cannot find package "code.google.com/p/google-api-go-client/googleapi" in any of:
and many other who said the same.
How I can use package download from a go get?
Thank you.
Typically a gopath looks like this: (I have added random projects to it to demonstrate what it could look like)
gopath
src
code.google.com
p
google-api-go-client
etc
github.com
fluffle
goirc
rohan.com <- This is where your own projects go(or in code.google.com or github.com)
my_random_project
main.go
helper.go
my_app_engine_project
app
app.yaml
my_app_engine_project.go
routes
random_rest_route.go
process
random_route_logic.go
pkg
bin
Your $GOPATH$ enviroment variable should point to that root folder which contains src, pkg and bin.
So when you go get a package from github for example it'l be put in the github.com src folder, and that's when you'll be able to use that library in your own projects.
Usage Example
So for example, if I need the fluffle/goirc library from github, I'l type:
go get github.com/fluffle/goirc
The library will then be placed in:
gopath/src/github.com
And I can use the library by importing it with:
import (
"github.com/fluffle/goirc/client"
)
And then use it
client.NewConfig("My User Name")

Resources