I have 2 solution files S1 and S2.
S2 has to run first and then S1 should run, because S1 has files that are dependent on the output of S2.
Is it possible to include solution S2 within S1, so that when I run S1, the execution starts with S2, and once S2 is completed then S1 is executed ? If possible, could you please tell me how to do so.
You could add a Pre-Build-Action and call MSBuild on your own. Syntax is like:
MSBuild MyApp.sln /t:Rebuild /p:Configuration=Release
Related
I'm trying to figure out how to use Gradle. I'm having this problem, which is trivial to solve in Makefiles, CMake, etc, but I have not idea how to do it in Gradle.
Let's say I have an application that contains some resource files inside. Those resource files are generated from a set of input files, and are put inside the application in compiled form.
I'd like to instruct Gradle to automatically generate those resources when it's needed by pointing it to the resource input files. So, effectively I'd like to do something like this:
all: out1 out2
#echo done
out1: in1
cat in1 | xxd > out1
out2: temp1
cat temp1 | xxd > out2
temp1: in1
cat in2 | tr '[:lower:]' '[:upper:]' > temp1
(let's skip this unfortunate effect when if xxd will fail then an invalid out1 will be generated)
Let's say out1 and out2 are my resource files that I'd like to embed inside the application. These files are generated by different rules:
out1 is generated from in1 by processing it with xxd (it's just an example),
out2 is generated from in2 by first uppercasing it, and then piping it through xxd. A temporary file, temp1 is being created in the meantime, but that's just a temporary file and it's not important at all.
So what I'd like to achieve in Gradle is basically an equivalent of the Makefile script pasted above with all its features; I mostly mean that out1 and out2 shouldn't be generated if in1 and in2 didn't change (because the resource generation phase can be expensive and time consuming, so I'd like to avoid having to run it on each build), and the possibility of the build system to automatically figure out how to run the build in parallel, so that out1 and out2 is being generated at the same time.
I'm trying to dig up the docs for Gradle and some examples, but 95% of what I find are some opaque scripts that use some particular plugin, which nobody explains how it works inside. The docs say that Gradle is an "automation tool", so it should be perfectly doable what I'm trying to achieve, but is it really the case? Is there any sense in trying to use Gradle as a tool for the use-case described in this post?
Doable. Just need a bit of imagination. Gradle tasks can be created at runtime and to my knowledge it needs the inputs you need to generate tasks be ready when you invoke gradle (not sure if tasks can still be created once one task had already started, I haven't personally tried).
For your use case, you may just need to execute a separate gradle command (separate build file) once the input is ready. Gradle allows you to invoke any shell command, so just spawn off another gradle call.
Here's a sample on how you may create new tasks dynamically (multiple tasks are spawned off from an array, you may just read yours from a file): https://github.com/HCL-TECH-SOFTWARE/DX-Modules-and-ScriptApps/blob/main/06ThemeComponentInApp/DxModule/build.gradle
I use apktool_2.5.0.jar b The_App_v0.1.apk to decompile. I edit names in few files. Im not sure if it requires making a change to mainfest.xml but neither worked. Then I do apktool_2.5.0.jar b The_App_v0.1 , all I see is a build\ folder is created in which I see some classes.dex file being made, no apk no dist folder ??
Then I cant even rename the folder or anything because it is used by some process.. the only process can be java which I dont see running.. This APKtool is GARBAGE
As it often happens, one day waste hours for nothing, the next day it works from first time.
Possible solution: apktool_2.5.0.jar b "The_App_v0.1"
... the quotes I read somewhere it cant recognize paths and doesnt know what it's doing
Possible solution: apktool_2.5.0.jar b "The_App_v0.1" ... the quotes I read somewhere it cant recognize paths or maybe space or even dots and doesnt know what it's doing
compilation
I have a directory, let's call it inputs. I need to create a task that will:
read in all of the files in the inputs directory, ie: inputs/*.
produce a new file somewhere else that combines these files in some way. (For the sake of example, you can assume I just want to concatenate all of the files into a single output file.)
How do I set up the task correctly such that the following requirements are met?
requesting the task a second time when nothing has changed doesn't execute the task ("Already up to date").
adding, editing, or deleting files in the inputs directory causes the task to be "out of date", and so requesting it after any of those has happened will cause it to re-execute.
Suppose I have a folder (group var folder) in which there are multiple sub folders. The folder names are based on version number such as 1.0.1 and 1.1.1 etc. If I define the same variable in multiple sub folders, which one will Ansible pick?
All files in your group var folder and subfolders will be applied recursively.
Files and folders are sorted alphabetically on every level before processing.
The last processed variable assignment wins.
Here is the example of processing order:
./group_vars/testit/1.yml
./group_vars/testit/v0
./group_vars/testit/v0/1.yml
./group_vars/testit/v1
./group_vars/testit/v1/1.yml
./group_vars/testit/z.yml
In this case if testvar is a in v0/1.yml and b in v1/1.yml, testvar will have b value in the end.
I am somehow failing to cp certain files iteratively to the relevant directories.
I have a directory ORIG and 3 DIRECTORIES G1 G2 and G3 where I want to use data from ORIG.
I have this:
i=1; for((i=1;i<=3;i++)); do;
cp ORIG/f$i'_'* G$i/;done
Why doesn't the star work so that I can get all the files that start with f1 to the directory G1/?
I think it should be:
for((i=1;i<=3;i++)); do
cp ORIG/f$i'_'* G$i/; done
Pay attention to the first line. You should not write a semicolon after do. You can omit the "i=1", because you're already doing this in the for-loop.
This will copy files of the form "ORIG/f$i_*" to "G$i".