How to I pass GIT's username and password to gradle plugin? - gradle-release-plugin

I'm trying to release using the gradle release plugin but whenever the plugin is using GIT, it's not passing my username and password:
I 'm invoking it as:
I'm using:
C:\GradleReleaseTest>gradle --version
------------------------------------------------------------
Gradle 2.11
------------------------------------------------------------
Build time: 2016-02-08 07:59:16 UTC
Build number: none
Revision: 584db1c7c90bdd1de1d1c4c51271c665bfcba978
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_66 (Oracle Corporation 25.66-b18)
OS: Windows 7 6.1 amd64
My gradle release configuration looks as:
release {
failOnCommitNeeded = true
failOnPublishNeeded = true
failOnSnapshotDependencies = true
failOnUnversionedFiles = true
failOnUpdateNeeded = true
revertOnFail = true
preCommitText = ''
preTagCommitMessage = '[Gradle Release Plugin] ${release.releaseVersion} - pre tag commit: '
tagCommitMessage = '[Gradle Release Plugin] ${release.releaseVersion} - creating tag : '
newVersionCommitMessage = '[Gradle Release Plugin] ${release.releaseVersion} - new version commit: '
tagTemplate = '${version}'
// May decide to add additional custom tasks here
buildTasks = ['build']
scmAdapters = [
net.researchgate.release.GitAdapter
]
}
The error I'm getting looks like:
C:\GradleReleaseTest>gradle release -Prelease.releaseVersion=1
.0.0 -Prelease.newVersion=1.0.1-SNAPSHOT -Prelease.username=jvergara -Prelease.p
assword=thePassword
:release
:com.mycompany.gradletest:createScmAdapter
:com.mycompany.gradletest:initScmAdapter
:com.mycompany.gradletest:checkCommitNeeded
:com.mycompany.gradletest:checkUpdateNeeded
Running [git, remote, update] produced an error: [bash: /dev/tty: No such device
or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.mycompany.com': Invalid ar
gument
error: Could not fetch origin]
:com.mycompany.gradletest:checkUpdateNeeded FAILED
:release FAILED
Release process failed, reverting back any changes made by Release Plugin.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkUpdateNeeded'.
> Failed to run [git remote update] - [Fetching origin
][bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://git.mycompany.com': Invalid ar
gument
error: Could not fetch origin
]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 5.912 secs

I managed to resolve this. The problem has nothing to do with the plugin at all, but rather how git itself work.
You either have to use a global config for the credentials or you have to use local config
See, https://git-scm.com/docs/gitcredentials. I used the local version and it works just fine.

Related

Cannot install kernel-devsrc

I'm trying to set up my environment to use Yocto's generated SDK to compile my out-of-tree module, but for some reason, I'm getting an error.
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
I'm using Poky distribution and meta-raspberrypi which is needed because I'm using the RPI ZeroW board.
Apart from this everything works fine. I'm able to compile the entire image and load it on the board.
Here is the line I've added to local.conf
TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"
as I've found in the documentation.
Also below you can find the whole log from the compilation.
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-bsp/u-boot/u-boot-tools_2020.07.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/binutils/binutils-cross_2.35.1.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/gcc/gcc-cross_10.2.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-support/gmp/gmp_6.2.0.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-extended/xz/xz_5.2.5.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-connectivity/openssl/openssl_1.1.1k.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/bison/bison_3.7.2.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-core/glibc/glibc_2.32.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_10.2.bb:do_populate_sysroot']
NOTE: Installed into sysroot: []
NOTE: Skipping as already exists in sysroot: ['u-boot-tools-native', 'binutils-cross-arm', 'kmod-native', 'gcc-cross-arm', 'gmp-native', 'pkgconfig-native', 'xz-native', 'openssl-native', 'bison-native', 'quilt-native', 'bc-native', 'glibc', 'patch-native', 'kern-tools-native', 'pseudo-native', 'gcc-runtime', 'python3-native', 'gnu-config-native', 'autoconf-native', 'libtool-native', 'gtk-doc-native', 'automake-native', 'zlib-native', 'texinfo-dummy-native', 'readline-native', 'flex-native', 'attr-native', 'libmpc-native', 'mpfr-native', 'linux-libc-headers', 'gettext-minimal-native', 'libgcc', 'libnsl2-native', 'gdbm-native', 'libffi-native', 'bzip2-native', 'util-linux-native', 'sqlite3-native', 'libtirpc-native', 'm4-native', 'ncurses-native', 'libcap-ng-native', 'libpcre2-native']
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing shell function do_install
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
WARNING: exit code 1 from a shell command.
ERROR: Execution of '/home/pp/yocto-hh/build/tmp/work/hhctrl-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.109942' failed with exit code 1:
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
WARNING: exit code 1 from a shell command
The command I am using to produce the SDK is:
bitbake name-of-my-image -c populate_sdk
What could be the problem here? Or how should I debug it? I've found a few touching on the subject and it seems that it should be already fixed, but for some reason, in my environment, it still does not work.
Missing the module.lds file in the latest kernel. Apply the following source code as a patch in the kernel and build the image.
diff -Naur a/arch/arm/kernel/module.lds b/arch/arm/kernel/module.lds
--- a/arch/arm/kernel/module.lds 1970-01-01 05:30:00.000000000 +0530
+++ b/arch/arm/kernel/module.lds 2020-02-28 21:53:45.000000000 +0530
## -0,0 +1,5 ##
+/* SPDX-License-Identifier: GPL-2.0 */
+SECTIONS {
+ .plt : { BYTE(0) }
+ .init.plt : { BYTE(0) }
+}

Why when I want to run an Android yarn error like this?

Why when I want to run an Android yarn error like this?
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :app:processDebugResources FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
10 actionable tasks: 2 executed, 8 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource m
ipmap/ic_launcher (aka com.konspirasisnack:mipmap/ic_launcher) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource s
tring/app_name (aka com.konspirasisnack:string/app_name) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource m
ipmap/ic_launcher_round (aka com.konspirasisnack:mipmap/ic_launcher_round) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource s
tyle/AppTheme (aka com.konspirasisnack:style/AppTheme) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:13:7-23:18: AAPT: error: resource
string/app_name (aka com.konspirasisnack:string/app_name) not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. R
un with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 35s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnat
ive.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
react native versi 0.62.2
distributionUrl=https://services.gradle.org/distributions/gradle-6.0.1-all.zip
os windows 10
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
ANDROID_HOME = C:\Users\user\AppData\Local\Android\Sdk
JAVA_HOME = C:\Program Files\Java\jdk

RNC Slider lint FAILED on ./gradlew clean build and release apk crashes on app start

Before assembling release, I'm trying to make clean build but it throws error and fails the task. When I generate release apk (succesfully generates), after installing it on my LG G4 phone (also tried Samsung Galaxy J3), it is crashing and not starting.
My app succesfully works with react-native run-android on my phone.
Before assembling release build, I typed
cd android
./gradlew clean
./gradlew buildcache
./gradlew clean build
and the last command always gives errors.
After adding
android {
lintOptions {
abortOnError false
}
}
to RNC Slider's build.gradle file as the errors say, ./gradlew clean build succesfully finishes its task. But still I can't open the app after generating and installing release apk.
./gradlew clean build error:
...
> Task :#react-native-community_slider:lint FAILED
Ran lint on variant release: 3 issues found
Ran lint on variant debug: 3 issues found
Wrote HTML report to file:///D:/React/Pure%20RN/dassist/node_modules/#react-native-community/slider/android/build/reports/lint-results.html
Wrote XML report to file:///D:/React/Pure%20RN/dassist/node_modules/#react-native-community/slider/android/build/reports/lint-results.xml
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':#react-native-community_slider:lint'.
> Lint found errors in the project; aborting build.
Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
lintOptions {
abortOnError false
}
}
...
Errors found:
D:\React\Pure RN\dassist\node_modules\#react-native-community\slider\android\src\main\java\com\reactnativecommunity\slider\ReactSliderManager.java:68: Error: Value must be ? 0 (was -2) [Range]
ViewGroup.LayoutParams.WRAP_CONTENT,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BU¦LD FAILED in 35s
163 actionable tasks: 154 executed, 9 up-to-date
And this is a part of the xml report file (warnings excluded) mentioned in output logs:
<issues format="5" by="lint 3.3.1">
<issue
id="Range"
severity="Error"
message="Value must be ≥ 0 (was -2)"
category="Correctness"
priority="6"
summary="Outside Range"
explanation="Some parameters are required to in a particular numerical range; this check makes sure that arguments passed fall within the range. For arrays, Strings and collections this refers to the size or length."
errorLine1=" ViewGroup.LayoutParams.WRAP_CONTENT,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="D:\React\Pure RN\dassist\node_modules\#react-native-community\slider\android\src\main\java\com\reactnativecommunity\slider\ReactSliderManager.java"
line="68"
column="13"/>
</issue>
</issues>

Getting BlazeInfoException in IntelliJ from the Bazel plugin

I just installed the Bazel plugin for IntelliJ, and I keep getting this exception:
com.google.idea.blaze.base.command.info.BlazeInfoException: blaze info failed with exit code: -1
java.util.concurrent.ExecutionException:
com.google.idea.blaze.base.command.info.BlazeInfoException: blaze info failed with exit code: -1
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:502)
[...]
at com.google.idea.blaze.base.async.FutureUtil$Builder.lambda$run$0(FutureUtil.java:93)
[...]
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:548)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
at com.google.idea.blaze.base.async.executor.BlazeExecutor$3.call(BlazeExecutor.java:108)
at com.google.idea.blaze.base.async.executor.BlazeExecutor$3.call(BlazeExecutor.java:105)
[...]
Caused by: com.google.idea.blaze.base.command.info.BlazeInfoException: blaze info failed with exit code: -1
at com.google.idea.blaze.base.command.info.BlazeInfoRunnerImpl.runBlazeInfo(BlazeInfoRunnerImpl.java:105)
at com.google.idea.blaze.base.command.info.BlazeInfoRunnerImpl.lambda$runBlazeInfo$2(BlazeInfoRunnerImpl.java:75)
... 6 more
Edit: I am using IntelliJ 2017.3 on MacOS El Capitan 10.11.6, Java JRE 1.8.0, and the Bazel version is 0.8.1-homebrew (the plugin version is 2017.11.20.0.4). I get this error when I try to setup a new Java project (an Hello World with only one class and one BUILD file containing a java_binary similar to this tutorial), and it appears when I click on the Bazel sync button.
The output in the Bazel console is:
Syncing project: Sync (incremental)...
Updating VCS...
Running Bazel info...
Command: info --tool_tag=ijwb:IDEA:community --curses=no --color=no --experimental_ui=no --progress_in_terminal_title=no --
==== TIMING REPORT ====
Sync: 47ms
BazelInfo: 4ms
Timing summary:
BlazeInvocation: 4ms
Sync failed
Command: git diff --name-status --no-renames abc8913346474d12ad45226503438848011929ae
Does anybody have an idea about what is it and/or how to fix it? Thanks!
I found my answer, thanks to this post.
In IntelliJ > Settings > Other Settings > Bazel Settings, the field "Bazel binary location" was empty. For my case, I entered /usr/local/bin/bazel and now it works!

Build chromium for raspberrypi2 on wayland with yocto project brings error related to egl.pc and wayland-egl.pc

I have completed building qt5 on raspberrypi2 by following the instruction here: http://www.embarcados.com.br/raspberry-pi-2-qt5-yocto-parte-1/
My next goal is to build chromium with wayland and egl. I have added one more layer from "https://github.com/OSSystems/meta-browser".
Actually, I could successfully build chromium with x11 but still failing with wayland. The things I did for wayland is to add "wayland" with DISTRO_FEATURES_append = " wayland" and remove x11 with DISTRO_FEATURES_remove = " x11".
However, this yields errors and the error messages mentions that missing "egl.pc" and "wayland-egl.pc". Should I add some more components in "DEPENDS" section which will be pre built and create those two package config files in addition to those components in chromium.inc? The build configurations and error messages shown are below.
Build Configuration:
BB_VERSION = "1.26.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "raspberrypi2"
DISTRO = "poky"
DISTRO_VERSION = "1.8"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard vfpv4 cortexa7"
TARGET_FPU = "vfp-vfpv4-neon"
meta-embarcados
meta-rpi = "fido:dfb2e27bf26b109fc6ccb3bc91924fb3bb24f655"
meta-qt5 = "fido:fc026381545650e10fdd488d5b2a3b2d78f87793"
meta-raspberrypi = "fido:b896a7da70dd7a16ba7ffd664f7747cb37e1d142"
meta-oe
meta-ruby
meta-gnome = "fido:10d3c8f85280a0bf867a8e4f84bcda81c290d28e"
meta
meta-yocto = "fido:cd2c9acdbd75c83790e8144d2a834f5b5de35df0"
meta-browser = "master:ca96f4326345dcd779fc539877a04f069f431749"
NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_configure (log file is located at /home/paul/yocto/build-browser-fido/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/chromium/40.0.2214.91-r0/temp/log.do_configure.13805)
ERROR: Logfile of failure stored in: /home/paul/yocto/build-browser-fido/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/chromium/40.0.2214.91-r0/temp/log.do_configure.13805
Updating projects from gyp files...
Package xcb-shm was not found in the pkg-config search path.
Perhaps you should add the directory containing xcb-shm.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcb-shm', required by 'cairo', not found
gyp: Call to 'pkg-config --cflags pangocairo pangoft2' returned exit status 1.
Requested 'egl >= 9.1.3' but version of egl is 0.0
Package wayland-egl was not found in the pkg-config search path.
Perhaps you should add the directory containingwayland-egl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'wayland-egl' found
gyp: Call to 'pkg-config --cflags "egl >= 9.1.3" "wayland-client >= 1.4.0" >>
Thank you very much for your help.
I found that I should have not done DISTRO_FEATURES_remove = " x11". However, I`m still attempting to launch chromium based on wayland compositor.