I'm currently working on a little pet project that takes a code file and deploys it using NuGet. I can currently replace the namespaces in the project using the $rootnamespace$ token and the .pp extension, but I'm curious if there is a better way.
My chief complaint is that I have to take code which builds correctly and transform it temporarily into something that no longer does so.
Is there a way for me to perform these transformations without having to alter my source code directly?
So, I created a very simple NuGet Preprocessor that looks at my solution and creates a shadow copy that has been tokenized and transformed to adhere to the NuGet standard. Works like a charm and now I can very easily deploy source files directly.
Related
I'm wanting to create a pipeline on Github for a C++ project that will build, test, and document it. The project is supposed to be compiled with GNU Make, but for now, it can be done using CMake as I can change it later. I want it to run tests using google test and also automatically create documentation for it (I've used Doxygen in the past which nicely makes HTML formatted documentation from your comments).
I've tried to get this working and used a bunch of different yaml files I've found online, but I can't get it working exactly right. The best I've been able to do is get it to build and for the tests to run, but I can't get the automatic documentation to work. Doxygen is reliant on a Doxyfile to configure it, but I'm not sure of a simple way to configure it (stuff I've found online seems overly complicated for what I want). I'm open to using a different method for automatically generating documentation if there's one that would work better.
When writing a contract for an API i found myself repeating the same things over and over. For example regex validations for complex json object need to be copy pasted.
Thats tedious and not very DRY.
I'm using Kotlin DSL and Maven
I tried to extract the common parts in another file to reuse it. (Kotlin extension functions ftw.)
After trying multiple things to reuse that file I gave up.
The common parts should be as close to the actual contracts as possible. I don't want to export them in another project, and build them seperat, as they are an vital part of the contracts.
I tried it the following ways:
just put the file in the same directory and importing the functions, hoping it would be resolved as it would in java - did not work at all (my expectations were low, was worth a shot)
putting it in another maven module, and add that as dependency to the spring-cloud-contract-maven-plugin. that worked, as long as the dependant module was built and installed in the local maven repo. if no built version was available maven could not resolve it.
experimenting with kotlin script #file:Import() and #file:DependOn to tackle my issue, no luck.
Is there another way, that I missed? Is there a prefered way doing this?
This must be a common issue, right?
I have a Spark project which uses HDFS. I need to edit some things in the source code of Spark, which is possible since it is open source.
However, I'm wondering on how to get all of this together and working. I downloaded the source-jar for Spark and attached it to my IntelliJ project, which by the way builds with Maven. This has given me the possibility to go from my code and for example use Ctrl+B to go and see the source code of SparkContextor any other code in the Spark library.
Anyhow, this code is locked and I cannot modify it. I have not found a way to unlock it. So after some searching on the internet it seems like the solution would be to find a way to build the whole Spark library as part of my project instead of using it as an external library.
How would I go by doing this? I am lost as to how to add it so the source code is part of the project, which package would it be a part of and so on? I have no idea where to start or how to do it at all.
You are probably better off checking out the latest source code for Apache Spark, create a feature branch, put your changes there and then probably submit a merge request, so that it is officially available as part of the Apache packages.
If you do not want to do that, you could of course do it all by yourself, with just building the Spark package by yourself, having it somewhere in your company's internal repository so that you can pull it from there from your different environments.
Seems like there is no way to automatically create and manage resx files in VS Code now. Does someone know extension for it?
P.S. Yeah, I know that I can edit resx file as bare xml, but it`s not a right way.
The problem with resx is that it uses a Visual Studio "Custom Tool" to generate the code for the resources, and so requires Visual Studio to function fully.
I've been working on a replacement to resx that should also work from VS Code. It uses json rather than xml to define the resources, but otherwise behaves much like a resx file. The json resources file uses a ".resj" extension, and has a very simple structure. It currently only supports string resources that can be defined either inline in the json, or in an external file reference.
The project is open source on GitHub here:
https://github.com/MarkPflug/Elemental.JsonResource/
This is available as a nuget package "Elemental.JsonResource", currently only pre-release. Simply add this package to your project to enable using resj files. It doesn't add a runtime dependency to your project, everything is done at build-time. My hope is to provide feature-parity with what a resx file can do, but it could be useful even in its current state.
This is my situation: We have a third party feature in our Eclipse environment. The feature contains several plugins. The plugin contains a bunch of classes. One of the classes contains a bug.
We have been able to find a solution to the bug, so we have a working version of the class with the bug.
Unfortunately this plugin is covered by a 55 page long EULA (by IBM) so I think it's pretty safe to assume that decompiling the jar, exchanging class files, recompiling and distribute is legally out of the question. I'm no legal expert, but I'd guess we cannot tamper with the jar files in any way.
So this means I have a single class file that I want to be loaded instead of a class in a plugin, is this at all possible?
This page suggests using fragments, but this requires modifying the manifest in the plugin.
This question has the same problem as me, but in that case there is access to the source code and he is able to build a plugin.
This blogpost shows how use feature patches, but they require that I'm able to build my own plugin, which I cant since I have just the one class.
I would not try using a fragment. In my experience, the cleanest thing to do would be to use a feature patch. I have successfully used feature patches to do exactly what you are looking to do. It's not simple, but it is robust. You need to do the following.
create a plugin that encapsulates your single class file
create a feature patch that includes your new plugin and that patches the feature that you are targeting.
export your feature patch and create the p2 metadata (to create an update site).
Install into your Eclipse using the install manager
Rejoice!
(optional) Feature patches by default only target a single version of the target feature. So, if the target feature bumps up its version number, the feature patch will silently no longer be applied. However, it is possible to relax the version constraints on the feature patch. This process is described in detail here: http://aniefer.blogspot.com/2009/06/patching-features-part-2.html
More information:
http://aniefer.blogspot.com/2009/06/patching-features-with-p2.html
http://aniefer.blogspot.com/2009/06/patching-features-part-2.html
The benefit of using a feature patch over a fragment is that anyone can install the patch and get the patch working, but things are more difficult with a fragment in that end users must muck with manifests.
So this means I have a single class file that I want to be loaded instead of a class in a plugin, is this at all possible?
Your first sentence is the answer. You can use a fragment, but that requires modifying the manifest in the plugin. Otherwise, Eclipse would have no idea which class to load.
My suggestion is that you write IBM with all of this information, including the patch. IBM should be able to release a maintenance fix which would solve your problem.
In the mean time, you could pursue the fragment option, which would require you to unpack the jar, add your fragment, modify the manifest, and repackage the jar. Whether or not this is legal is beyond my ability to determine.