Managing Android Studio dependencies - android-studio

I have a few issues:
When I want to add 'Google dependency' I can simply open project
dependencies and choose proper library dependency, but this is not
working for all 3rd party libraries (ex. Retrofit). So I have to go
to their website copy URL and figure out the required version and
combine proper URL- it would be nice to have some kind of auto
completion here, to make this process faster.
Is there a simple way to check for newer versions? Ex. I have 10
dependencies in my project and I would like to know if some of them
should be updated (I know I may update versions automatically, but I
don't always want this)

Android Studio highlights outdated dependencies in your app build.gradle file. If you mouse over the highlighted dependency, it will tell you the newest version.
To update the dependency, just replace the current version (e.g. 'com.android.support:appcompat-v7:25.4.0') with the new version (e.g. 'com.android.support:appcompat-v7:26.0.0'

Related

Setting up a proper dev environment with CI for react-native, typescript, nodejs

Unfortunately, we have projects with different nodejs versions. I am not sure if this is like java where I can have multiple jdks installed(multiple nodejs installed) and each project magically uses the correct version via a config file? Also, most commands in tutorials are not including version numbers when installing tools and libraries like so
npm install -g expo-cli (tool)
npm install #react-navigation/native (library)
Coming from gradle with the gradle wrapper where everyone on the team uses the tools and library versions defined in the build.gradle file, this is odd to me. In the gradle world, everyone on the team uses the same exact version of gradle(gradle itself ensures if one person upgrades it in the repo, everyone gets the upgrade and stays in sync on the same version). Then there is plugins/tools and those versions are defined and then libraries and those versions are defined.
How do I guarantee everyone is using the same npm, node, expo, etc. tools?
How do I guarantee everyone is using the same libraries?
How do I guarantee everyone is using the same typescript?
Ideally, we upgrade any of these in the repo + any fixes to the upgrade so on checkout, developers start using the new tool + new *.tsx files so it is seamless much like in the gradle world. In gradle, I upgrade the
version via a property
versions of plugins/tools
build.gradle files
any source code files
and check that all in as a unit such that any developer that checks out is using all the correct versions together. I want this in react-native for our ios/android mobile project or as close as I can get.
I have hacked things before as in installing 'ant' into the git repo and this worked wonders(even though it is such an ugly hack) and everyone used the tool in the repo instead of the one on their OS. Perhaps there is a way to do that?
A bloated repo with binaries was worth it's weight in gold to prevent version compatibility hell as people upgraded libraries over time. NOT only that we found that tool bugs were easier to track down as we could revert the repo. NOT only that, we could reproduce builds form 1 year ago as the tooling was reverted where todays npm tools can't build the 1 year ago thing due to all the changes. The advantages just kept piling up and up and I can't even remember all of them.
Tooling running from the repo either via bootstrap like gradle wrapper or full blown thing is generally the best option until the full blown thing is really bloated but even then locking it to a hash on another tool repo could be better
Any ideas welcome here to put my team on all the same tooling(works great for people joining the company or team from another project as well to not have to install much).
thanks,
Dean
Typescript and libraries should be taken care of by removing any carets and tildes in your package.json and specifying exact versions.
One low overhead possibility for the rest could be shell scripting and a private package repo. You could host the versions you want to install internally, and get it all through cURLs.
Or you could add some simple scripts in your npm pre-install, for example nvm use 12.2.1 should, through error messages, guide the user to installing nvm and using the proper version.

Catel 4.0.0 and Dependency on Microsoft.Bcl.Build

When updating a project to use current Catel version (4.0) I am getting this warning:
All projects referencing MyInfrastructureProject.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.
The error is reported for projects that references MyInfrastructureProject.csproj.
I find it odd that I need to add additional libraries to other project especially when it is concerned with nuget (if I am getting the picture correctly) and not with actual functionality of my code (or maybe even Catel). But in any case, I don't really understand the issue.
I searched a little for this issue but didn't find relevant details or explanations.
Should I go ahead and add the Microsoft.Bcl.Build reference everywhere in my project?
Thanks,
Tomer
If you don't know what is Microsoft.Bcl.Async you should study it.
Catel uses this feature pack so as to use async/await on .NET 4 and Silverlight 5. So if you use Catel in a .NET 4 project, you inherit the same dependencies, which is what the warning says.
Thus, yes, please go ahead and add the NuGet package to the necessary projects, or simply upgrade your projects to .NET 4.5 and reapply the NuGet packages.

Using specific version of packages in MonoDevelop

What is the best way to handle specific version of libraries while using MonoDevelop (precisely - use ServiceStack v3 instead of ServiceStack v4)?
Unfortunately, MonoDevelop's addin NuGet does not allow specifying package version (no Package management console support). I've tried hacking it in .csproj and package.config file but it does not work entirely well and it seems to be smelly solution.
One obvious solution is to get rid of NuGet and reference libraries locally after manually downloading them.
How would you solve this problem?
Thanks for all responses :)
Being able to add a specific version of a NuGet package with the MonoDevelop addin is on the todo list.
If you have access to Windows you could use SharpDevelop to add a specific version using its Package Management console.
Or as you have suggested, edit the packages.config file, then restore the packages. However you will need to add the required assembly references by hand. This option is not that bad if there are not that many assembly references and you are not going to be updating the NuGet package very often. Although the benefit of this approach over downloading the NuGet package, extracting it, and directly referencing the assemblies is equivalent and the same amount of work. Also doing it this way you can more easily update the references by simply dropping the new binaries into your lib folder.
Or you could change the source code of the addin. I thought about adding a simple text box where you could specify a particular version. Ideally the dialog would give you a list of available versions.
I would probably just download the ServiceStack assemblies you need and directly reference them.

updating a component using NuGet, when one project in the solution is already updated to the latest one

I have a general framework project which is referenced by many solutions. Whenever there is an update to a component which I would like to upgrade to, I normally right-click on the solution > Manage NuGet packages for solution > upgrade component for all projects. The problem is that for all other solutions, their projects (except from the common referenced one) is not updated to the latest one. If I try to do the same, it will not let me click on 'Update' to update all projects, as it detects that one project is already using the latest version. I have some other 4 or 5 projects in most solutions, and it is quite a headache to update them manually. Any ideas about it? I am using the latest version of NuGet and VS2012.
Right-click the outdated project in the solution and select Manage NuGet Packages from the context menu. Your Manage NuGet Packages window will now only affect the scope of that one project you selected and you should be able to perform an update to the project directly. Repeat for all your other packages.

Create Upgrade Patch For InstallShield Installer

For our latest release, we want our customers to only download an upgrade patch of our applications and instead of uninstall and re-install all the process will be done by upgrader patch but I know nothing about this even after I googled it! Where to start guys? Note that our new release includes database upgrade as well as production code!
We are using .NET 4.0, Visual Studio 2010, C# and VB.NET in our software.
I might be a bit late to the party but hopefully this post helps anybody else who is looking for this answer.
You can use the 'Patch Design' method to create patches. You can find it in Installation Designer tab under Media.
For this you will need the latest build (msi/exe) and one or more previous build(s). In 'Patch Design' add a new patch configuration. From there you can specify latest version and previous version(s) of your setup file. If you are using Express version then you will need uncompressed build for both latest and previous. If you have Professional version then it can decompress it for you.
After this, just hit Build Patch and it will create a update.exe with only differences between latest and previous builds. It is quite smart in a way where it will only add the binary differences.
Good luck.

Resources