Configure gradle wrapper for all subprojects - kotlin

I have the following monorepo structure:
root/
├─ gradle/
│ ├─ wrapper/
├─ services/
│ ├─ Consumer/
│ │ ├─ build.gradle.kts
│ │ ├─ settings.gradle.kts
│ ├─ Reader/
│ │ ├─ build.gradle.kts
│ │ ├─ settings.gradle.kts
//... more services
├─ gradle.properties
├─ gradlew
├─ gradlew.bat
I would like to keep the Gradle Wrapper at the top level. However, when I'm trying to import a single service into Intellij, I have to reconfigure the Gradle and provide gradle wrapper path.
I have seen there is an option to define gradle path by calling gradle wrapper task.
Is it possible somehow to configure the wrapper path as part of settings.gradle.kts in each service I have so me or other project members have to remember about changing IDE settings?

Related

Using GitHub Actions with a React/NodeJS + shared code monorepo

I'm writing an application split (at least for this repo) between a React frontend and an Express/NodeJS server.
Some of the code that I needed was used by both, so I split it into a third folder and used npm link to locally install it into the frontend and server folders.
shared-code/
├─ dist/ // output of npm build (tsc)
├─ src/
│ ├─ index.ts // export const sharedFn = () => {}
├─ tsconfig.json
├─ package.json
├─ package-lock.json
server/
├─ dist/ // output of npm build
├─ src/
│ ├─ index.ts // import { sharedFn } from 'shared-code'
├─ tsconfig.json
├─ package.json
├─ package-lock.json
frontend/
├─ dist/ // output of npm build
├─ src/
│ ├─ index.ts // import { sharedFn } from 'shared-code'
├─ tsconfig.json
├─ package.json
├─ package-lock.json
// in shared-code directory
npm run build
// in server directory
npm link ../shared-code
// produces in server/package.json
"dependencies": {
"express": "^4.18.2",
"shared-code": "file:../shared-code",
"ws": "^8.11.0"
},
The dist folders are generated by tsc (or npm run build, which for the frontend uses a CRA script) but are not stored in the repo. This seems to complicate the use of a GitHub action, since the shared-code/dist doesn't exist in a clean checkout, breaking naïve approaches to a separate script for each portion, and my attempts to use needs and a single yaml file.
I haven't been able to work out how to do this in a GitHub action, or how to approach this. I don't want to publish an npm package publicly, and my desired outcome would be to produce GitHub releases in a form that I can download them onto a remote device (by curl, wget, whatever) and then run them with node some/path/to/dist/index.js, chromium /some/path/to/dist/index.html. (But I'd say that all of deployment is not in the scope of this question - only writing in case it changes the suitable method.)

Using Vue3 and Vue2 simultaneously in monorepo

I have a problem building Vue3 and Vue2 apps in monorepo.
When trying to build the apps I see an error in Vue3 app:
error in ./src/App.vue
Syntax Error: TypeError: Cannot read properties of undefined (reading 'styles')
ERROR in ./src/App.vue
Module build failed (from ../../node_modules/#vue/cli-service/node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of undefined (reading 'styles')
at Object.loader (../../node_modules/#vue/cli-service/node_modules/vue-loader/dist/index.js:70:34)
# ./src/main.ts 2:0-28 5:10-13
Monorepo tool: TurboRepo
Package manager: yarn v1
Vue3 version: 3.2.13
Vue2 version: 2.6.11
Vue3 cli version: 5.0.8
Vue2 cli version: 4.5.17
webpack for vue3: 5.54
webpack for vue2: 4.46
Folder structure
├─ apps/
│ ├─ vue3-app/
│ │ ├─ package.json
│ ├─ vue2-app-1/
│ │ ├─ package.json
│ ├─ vue2-app-2/
│ │ ├─ package.json
├─ package.json
In the root package.json I declared workspaces
"workspaces": {
"packages": [
"apps/vue2-app-1",
"apps/vue2-app-2",
"apps/vue3-app"
],
I think it could be a problem with packages in root node_modules (Vue3 trying to use wrong package version?) so I tried yarn nohoist option but it didn't change anything
"nohoist": [
"vue3-app/**/vue",
"vue3-app/**/vue/**",
"vue2-app-1/**/vue/**",
"vue2-app-1/**/vue/**",
"vue2-app-2/**/vue/**",
"vue2-app-2/**/vue/**",
"vue3-app/**/vue-loader",
"vue3-app/**/vue-loader/**",
"vue2-app-1/**/vue-loader/**",
"vue2-app-1/**/vue-loader/**",
"vue2-app-2/**/vue-loader/**",
"vue2-app-2/**/vue-loader/**"
]
What could be causing the problem?

React-native installing required CocoaPods dependencies stuck

i cant finish react-native init as the process keep stuck at instaling required cocoapods dependencies please help
this is a few part what shown in terminal:
[4/4] 📃 Building fresh packages...
success Saved lockfile.
success Saved 48 new dependencies.
├─ #babel/core#7.5.0
├─ #babel/runtime#7.5.0
├─ #react-native-community/eslint-config#0.0.5
├─ #types/eslint-visitor-keys#1.0.0
├─ #typescript-eslint/eslint-plugin#1.11.0
├─ #typescript-eslint/experimental-utils#1.11.0
├─ #typescript-eslint/parser#1.11.0
├─ #typescript-eslint/typescript-estree#1.11.0
├─ acorn-jsx#5.0.1
├─ acorn#6.2.0
├─ ajv#6.10.0
├─ babel-jest#24.8.0
├─ chardet#0.7.0
├─ doctrine#3.0.0
├─ emoji-regex#7.0.3
├─ eslint-scope#4.0.3
├─ eslint-utils#1.3.1
├─ eslint#6.0.1
├─ espree#6.0.0
├─ esquery#1.0.1
├─ external-editor#3.0.3
├─ file-entry-cache#5.0.1
├─ flat-cache#2.0.1
├─ flatted#2.0.1
├─ functional-red-black-tree#1.0.1
├─ glob-parent#3.1.0
├─ ignore#4.0.6
├─ import-fresh#3.1.0
├─ inquirer#6.4.1
├─ is-extglob#2.1.1
├─ is-glob#4.0.1
├─ jest#24.8.0
├─ json-stable-stringify-without-jsonify#1.0.1
├─ levn#0.3.0
├─ lodash.unescape#4.0.1
├─ metro-react-native-babel-preset#0.55.0
├─ optionator#0.8.2
├─ parent-module#1.0.1
├─ path-dirname#1.0.2
├─ progress#2.0.3
├─ react-refresh#0.2.0
├─ regexpp#2.0.1
├─ rxjs#6.5.2
├─ table#5.4.1
├─ text-table#0.2.0
├─ tslib#1.10.0
├─ tsutils#3.14.0
└─ write#1.0.3
✨ Done in 19.41s.
info Installing required CocoaPods dependencies
Installing required CocoaPods dependencies takes time. Waiting for about 30mins worked for me.
Waiting for about 40mins worked for me. Installing required CocoaPods dependencies takes time. See my screenshot.
Break with Ctrl-C.
Enter cd ios
Run pod install --repo-update
But anyway it is not fast. Need wait because big repo cloned into fs under the hood.
Fixed with this - Open Xcode and go to Xcode → Preferences → Locations, and make sure the command line tools is set to the version of Xcode you’re using.
Install CocaPods
CocoaPods is a package management tool for iOS and macOS development. We use it to add the actual React Native framework code locally into your current project.
We recommend installing CocoaPods using Homebrew.
$ brew install cocoapods
or
sudo gem install cocoapods
You can try to disable iCloud, this helped me.
I was having the same issue. Solved by changing my internet connection from WIFI to mobile data. Then I ran the following commands which worked for me:
$ pod deintegrate
$ pod install
Hope this will work.
It took a while for CocoaPods installation and I got error at the end. podfile was inside iOS folder with no .xcworkspace. I did pod install again (in iOS folder) and all good. Please make sure CocoaPods is installed.
I think the main problem is mismatch version of CocoaPods and react native dependency. So you can try update Cocoapods
sudo gem install cocoapods
and then go inside your react native project in /ios folder then install pod again with
pod install

How do I find the path to the top of my ROOT source tree?

I'm trying to build ROOT on my MacBook using the terminal; I'm very novice when it comes to programming and downloading these things and I haven't been able to find anything that can explain to me what I need to do. This is what I've done so far: downloaded and unpacked ROOT, installed CMake, and emac. I've just been following the instructions CERN has on their website Building Root.
I made a directory to contain the build, but now I'm on the step which says "Execute the cmake command on the shell replacing path/to/source with the path to the top of your ROOT source tree." However, I have no idea what the path is to the top of my ROOT source tree, nor do I even know what that is to be honest. I'm trying to use ROOT with Xcode because it's really the only compiler I'm familiar with.
How can I find what the path is to the top of my ROOT source tree?
Tree here means the directory tree, so the "directory" or "folder" to which you unpacked root.
So, if your directory structure looks like this:
Downloads
├── PlaneTicket
├── oldThings
│ ├── Pictures
│ ├── Movies
│ ├── PDF-Documents
├── backup
│ ├── data
│ └── dataset
├── backup2
│ ├── data
│ └── dataset
├── build (<- I assume your build directory is there)
├── ROOT
│ ├── bindings
│ │ ├── doc
│ │ ├── pyroot
│ │ ├── r
│ │ └── ruby
│ ├── build
│ │ ├── misc
│ │ ├── package
│ │ ├── rmkdepend
│ │ ├── unix
│ │ └── win
│ ├── cmake
│ │ ├── modules
│ │ ├── patches
│ │ └── scripts
│ ├── config
│ ├── core
│ │ ...
│ ├── doc
│ │ ...
│ ├── documentation
│ │ ...
│ ...
└── very_old_files
Then your cmake commands should looks like this
cmake ../ROOT
If you've followed CERN's instructions that far, you can simply use the command 'dir' or 'ls' and the path to source will print to screen. Type 'cmake', and then copy/paste that in front of it to build ROOT.

Share code between two similar React Native apps

I need an advice about the architecture and code organize of my app. I developed React Native application. Our business requires two apps instead one. The current app - for the current target audience. The second app should be for other target audience. Each app should have web-version. Part of the code in the application will be the same (business logic, features, common screens). The other part will be different. The app will have the different design theme, texts, icons, auth methods, payment methods and some more features.
I see it so:
├── mobile
│ ├── app1
│ │ ├── .env
│ │ ├── index.android.js (symlink to ../../lib/mobile/app/index.android.js)
│ │ ├── index.ios.js (symlink to ../../lib/mobile/app/index.ios.js)
│ │ ├── ios (symlink to ../../lib/mobile/app/ios)
│ │ ├── android (symlink to ../../lib/mobile/app/android)
│ │ ├── src
│ │ ├── node_modules
│ │ └── package.json
│ └── app2
│ ├── .env
│ ├── index.android.js (symlink to ../../lib/mobile/app/index.android.js)
│ ├── index.ios.js (symlink to ../../lib/mobile/app/index.ios.js)
│ ├── ios (symlink to ../../lib/mobile/app/ios)
│ ├── android (symlink to ../../lib/mobile/app/android)
│ ├── src
│ ├── node_modules
│ └── package.json
├── web
│ ├── app1
│ │ ├── src
│ │ ├── .env
│ │ ├── app.js
│ │ └── package.json
│ └── app2
│ ├── src
│ ├── .env
│ ├── app.js
│ └── package.json
└── lib
├── mobile
│ ├── app
│ │ ├── index.android.js
│ │ ├── index.ios.js
│ │ ├── ios
│ │ ├── android
│ │ ├── src (shared js-code for all mobile apps)
│ │ └── package.json
├── web
│ └── app
│ └── src (shared js-code for all mobile apps)
└── src (shared and business-logic js-modules for all apps)
Who had a similar experience? I will be glad to hear any ideas or advice from you.