Can't download json schema using gradlew command - apollo

I can't figure out how to use the gradlew command to convert my GraphQL schema into a JSON file as it is specified in the documentation.
I opened CMD in my project folder, ran the gradlew command once, and it gave me this error:
Project 'module' not found in root project gradlew
I created a module inside my project with the name "module" and now it's throwing the following error:
Task 'downloadApolloSchema' not found in project ':module'.
I've already added all the dependencies to the latest version (2.0.0 as of the time of posting) so I'm clueless as to why this is happening. I've already searched the web and found nothing about this...
This is the command I'm trying to issue in the CMD:
C:\Users\myuser\AndroidStudioProjects\GraphQLApp\app>..\gradlew :module:downloadApolloSchema -Pcom.apollographql.apollo.endpoint=https://graphql-udemy-android.herokuapp.com/graphql -Pcom.apollographql.apollo.schema=src/main/graphql/com/example/schema.json
I have to go up one directory (..\) since the gradlew command is in the above my app folder.
I'm on Windows, and my Gradle version is 6.4.

You just change ./gradlew to .\gradlew
Open the root terminal
Paste the code below and ENTER!
.\gradlew downloadApolloSchema --endpoint=https://Your Endpoint/graphql --schema=app/src/main/graphql/com/example/Your Path/schema.json
Have a good days!

Sorry about that, the module part was mostly a placeholder for the gradle module where you apply the com.apollographql.apollo plugin. You can ignore it and gradle will find the appropriate task:
./gradlew downloadApolloSchema
This has been updated in the project README as well.

For windows i used
.\gradlew downloadApolloSchema --endpoint="https://rickandmortyapi.com/graphql" --schema=app/src/main/graphql/GetRepositories.json
NOTICE I used:
.\ instead of ./

Related

Why is `eas` ignoring my `package.json` when building my project? Specifically, the `bundleIdentifier` is not being found

When running eas build --platform ios from Expo, I get the following error your project must have a bundleidentifier set in the expo config (app.json or app.config.js)., but I do have a bundleIdentifier set in app.json, under expo.ios.bundleIdentifier.
This guide was helpful in debugging.
In my case, it turned out my app.json file was in my .gitignore (because it's code genned from other files in my project so I don't want it committed), and eas doesn't upload files that are .gitignored.
I therefore solved it by introducing a .easignore in the root of my directory that did not exclude app.json.

Error while building WSO2 Microgateway project on Windows 10

I’ve been trying to explore WSO2 Microgateway and set up a Microgateway project. Building the project in Windows 10 with the command “micro-gw build project-name” is giving this error: “Could not find or load main class org.wso2.apimgt.gateway.cli.cmd.Main”.
I’ve downloaded the Toolkit and Runtime from https://wso2.com/api-management/api-microgateway/. I've set the Path environment variable to the /bin directory of the Toolkit and Runtime extracted folders, but still the “micro-gw build project-name” command is giving error “Could not find or load main class org.wso2.apimgt.gateway.cli.cmd.Main”. I’ve also cloned the source code from Github (https://github.com/wso2/product-microgateway/) which has the Main.java class and tried setting environment variables to its path.
I also tried setting the environment variables to the path where Toolkit batch file is present. I also followed the steps mentioned here, https://github.com/wso2/product-microgateway/#running-the-microgateway.
I'm assuming the Toolkit batch file (micro-gw) would execute the Main.java class coming up in the error.
These steps did not resolve the error. I'm new to Java based product, and I'm sure I'm missing something here.
Problem is with the init command not the build command. Init command is suppose to setup the TOOLKIT after the first use. It should extract the platform.zip file and copy all of the required resources to relevant places for you.
I hope you get the Project ___ successfully initialized message after running the init command. Just check $TOOLKIT_HOME/logs/ directory to see if there are any information on the log file.
If the log file also doesn't help, as a workaround, copy all the .jar files inside $TOOLKIT_HOME/lib/gateway/platform and $TOOLKIT_HOME/lib/gateway/cli to $TOOLKIT_HOME/lib/platform/bre/lib and try again, that should work.
Also please report this issue at https://github.com/wso2/product-microgateway/issues

Libgdx test from gradle command line assets not found

I have a LibGDX project with some tests. The structure is as follow:
core/src -> for my java sources code
core/test -> for my tests source code
core/assets -> for all my assets
When I run the tests from eclipse, they all go green but whenever I try to run them from the gradle command line (./gradlew test) I get an error with the assets folder. I believe this is because the tests are not launched from the assets folder as it is from eclipse.
How can I solve this problem ? Is there a way to tell gradle to use core/assets as the workspace directory when running the tests ?
Here is the error I get:
com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: myasset.png
I found a way to achieve what I wanted. I post my solution here for anyone that might need it. There is a property named workingDir for the test task in gradle. So I just needed to set it to the right folder. Inside the build.gradle file of your project (the root folder) just add the following section:
project(":core") {
apply plugin: "java"
// Add the following test section
test{
workingDir= new File("/assets")
}
// Rest of the file
}
That's it! My tests are running green from the command line now.

Why TestExplorer in VS2015 failed to load Pester module?

I installed the Powershell Tools for Visual Studio 2015 then I created a tests.ps1 files inside my Powershell project in VS2015. the test explorer recognizes the declared test, but when I try to run the test I get this: "Result Message: Failed to load Pester module. The specified module 'Pester' was not loaded because no valid module file was found in any module directory."
I discover that I did not have the Pester in my Pc, I download it from GitHub, then I add the folder to the $env:PSModulePath. Powershell identifies the module, but was not able to import it, so I move the folder from its original location to:
c:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
Now any console of powershell is able to import the module: ISE, Powershell console, Powershell interactive window in VS2015.
Then I try to run the test again, I keep getting the same message.
As I stated in my question: I added the folder with the Pester to the environment variable called PSModulePath, but I added to the end of it.
For some reason the adaptor looks for the path of module only under the first folder in that environment variable.
I changed the order and moved the path to the beginning of the string. Voila!! it works.

Use VS Online "Command Line" task with relative paths

I'm trying to use the new VS Online Build process and, specifically, package my app as a NuGet package.
To do so I have to execute something like "nuget pack". My source code is in GitHub and there, under the root folder, I have a folder called .nuget with all necessary to do the packaging.
I've added to my build template a "Command Line" step with this parameters:
tool: C:\a\9ea8689c\myusername\myproject.nuget\nuget.exe
arguments: pack
Everything else is defaults, included working folder. This works. However when I've tried to replace the absolute path for something like ".nuget/nuget.exe" or .nuget/nuget.exe or even changing the working folder to .nuget and from there just type "nuget.exe" it repeatedly fails because it can't find the tool.
Am I missing something? Should the task work with relative paths?
You should use absolute paths leveraging TFS Environment Variables like TF_BUILD_BUILDDIRECTORY.
In a batch file it is something like
echo Launching my own NuGet copy
%TF_BUILD_BUILDDIRECTORY%\myproject.nuget\nuget.exe
This worked for me: $(BUILD.SOURCESDIRECTORY)\NuGet.exe.
Notice the dot instead of underscore. I have put my NuGet.exe in the main repository folder, in my case NuGet 3.5 Beta.