not able to locate gradle.properties in toolbox - docker

I'm trying to run ./gradlew build command, which has artifactory_contextUrl property used in build.gradle file.
gradlew.properties is located in C:\Users\XXX.gradle folder, when I build the project in windows Intellij it takes the gradle.properties file in user folder and so gets the contexturl and everything is fine but,
when I try to build the project in docker toolbox it couldnt find it.
Toolbox starts with some location in C folder.
I tried with placing gradle.properties at the same level as build.gradle it works fine in toolbox. Eventually I dont want to keep the gradle.properties at buils.gradle level
What should I do? Does any one has any suggestions?

Well, I guess the docker toolbox (whatever it is, I don't know it) does run with another user account and thus does not find your gradle.properties file in your user directory.
The file is actually called gradle.properties, isn't it? In your question you use gradlew.properties and gradle.properties and only the latter is valid.
To solve your problem you can either make sure the gradle.properties is also in the users home directory that is used in the docker toolbox. To find out which directory this is, you can run Gradle with -d and search for Gradle user home, there it tells you which directory is the one where the gradle.properties is expected.
Alternatively you can use -P artifactory_contextUrl=asdf to set the property from the commandline, or use the system property org.gradle.project.artifactory_contextUrl or environment variable ORG_GRADLE_PROJECT_artifactory_contextUrl to set the project property.

Related

PyCharm: Unit testing directory setup with remote interpreter

For years I've been running a Docker container on my local machine and using it as a remote Python interpreter via SSH in PyCharm. This works great (though 2022.2.1 brought a lot of new bugs that have been slowly being ironed out) for running my code! I'm now on 2022.2.3.
However, I'm having issues running unit tests. In the past (i.e. before version 2022.2.1), I could simply right click my tests directory (a direct child of my main project directory) and click Run Python tests in test... and it would all work as expected.
Now, though, when I click this, I receive an error message about "No such file or directory."
I've tried everything I can think of- I've setup my path mappings in the Python test run config to exactly match those shown in my Python run config, and have tried every version of directory and subdirectory in the mappings and working directory, but I always receive an error about either having an empty test suite (no tests found), or that the directory "must be in the project."
It seems like no matter what I do, PyCharm is trying to create a temp directory somewhere, or is trying to read from some temp directory that I never specified, because I see errors this like:
AssertionError: /tmp/pycharm_project_405/docker/tests: No such file or directory
Yet I never created, specified, or requested a temp directory of any sort, let alone one named /tmp/pycharm_project_405/; this is a mystery to me.
PyCharm with an SSH interpreter is rapidly becoming unusable for me and my team because we cannot figure out how to set this up. Can anybody please offer some guidance on what we need to do?
Thank you all so very much!
I tried:
Changing run config for Python tests to match the working directory and path mapping of Python run configs (which work)
Directly specifying the path to the tests from the container's perspective
Setting up run config templates
Specifying one directory up/down from the actual tests
Expected:
Unit tests to be found and run as they were in previous versions of PyCharm
Answer
Create a run config for testing
In the testing run config, set Target: to Custom
Set the correct remote interpreter
Set Working directory to the test folder
Set TWO path mappings: 1) Map the code directory (in my case, the parent directory of the tests folder) and 2) Map the test directory itself
Voila!!!

How to move a file 'to a directory that's on your PATH'?

Im trying to install a JSON formatter for Cucumber but am having trouble configuring it. The steps (listed here) go like this:
1. Download cucumber-json-formatter-darwin-amd64 and rename it to cucumber-json-formatter
2. Move it to a directory that's on your PATH
3. Make it executable with chmod +x cucumber-json-formatter
4. Verify that you can run it: cucumber-json-formatter --help
I have the file downloaded and renamed correctly. However, I am stuck on the second step of moving it to a directory thats on my PATH.
Doing some research, I know what the folder structure looks like but I'm not sure exactly what the step is instructing. How would I achieve this step? Can it be in ANY directory on my PATH? I am currently using a Mac if that makes any difference for the solution.
Move it to a directory that's on your PATH
PATH refers to the machine's environment variable named PATH. Any time the OS is asked to execute something PATH is searched.
On Windows open System Properties dialog, click Environment Variables button and Path is listed there. You can add a new entry for the location of cucumber-json-formatter or you can move it to an existing Path entry.

How to get rid of files which end in .Identifier in Laravel

I cloned a laravel-8 sail project via gitlab but everywhere in every folder which containing files there is a file which ends in .Identifier
I don't know where they come from. There may be 1000 files like this in the project.
My question is:
How can I get rid of those files which endr with .Identifier?
Is there some kind of Ubuntu or docker command that searches the entire project for such file which ends in .Identifier and then deletes them?
Maybe phpStorm has such a function?
If you are on Linux machine, then open terminal in you project folder and run rm *.Identifier. And if you are on Windows machine then open command prompt in your project folder and run del *.Identifier. This will do the trick for you.

yeoman creates project in Desktop even though I CD into directory

I am having a issue creating a yeoman project. I cd in the directory type yo and it says:
Here is it suppose to asked me project name etc and it wants to throw everything on my desktop not the file I cd into. It defaults to mvn and I want gradle. I even npm uninstall -g generator-jhipster
and reinstalled it and got the same issue.
If you have a .yo-rc.json file in a parent directory, Yeoman will load that configuration and generate from that file instead of prompting. This allows developers to run a yo command from any folder in the project and have it apply to the correct files.
To solve this, remove the .yo-rc.json from the parent directory, in your case /Users/drew/Desktop.
For example, if you are in the directory /Users/drew/Desktop/new-project but /Users/drew/Desktop has a .yo-rc.json inside, Yeoman will change to the parent directory (Desktop), load the configuration, and generate the files from that folder instead of the child folder.
Based on your log it's looks like you are running yo in a folder where a .yo-rc.json is already existing. Careful under windows the .yo-rc.json can be that is of type hidden and you can't see it in explorer. Because of an existing .yo-rc.json you are not asked anymore for info e.g. project name, build tool etc. My recommendation will be to create a new folder run inside yo command

iOS Google Tag Manager Integration: How to add multiple containers per App environment?

I completed the integration of the latest Google Tag Manager (v5) for iOS together with Firebase (https://developers.google.com/tag-manager/ios/v5/).
The big change here is that the default container file is not binary anymore, it is plain JSON.
The integration requires that you have a folder (not group!) with the name "container" inside your app workspace. Within this folder the container file should be located. This raises my issue: We have two different GTM Containers, one for the testing/development app and one for production.
By using a folder it is not possible for me to add a different container file and set target references.
I can not create an additional folder since GTM requires the folder on root level and with the exact name "container"
Does anybody have an idea how this can be solved?
Thanks,
Fahim
You should be able to configure an XCode "run script" build step that clears the container directory and copies the correct container into place.
Sample Run Script (if somebody has the same issue):
rm -vf ${SRCROOT}/root_folder/container/*
cp "${SRCROOT}/root_folder/target/test/GTM-XXXXX.json" "${SRCROOT}/root_folder/container/"
It is important that this copy job is done at first within Build Phases, otherwise some other precompiling stuff of GTM does not recognize the container.

Resources