nix: replace grep and sed with AWK for parsing Gradle deps

The mess with regexes is hard to read and think about which is why it
had bugs with handling some Gradle formats.

It also lowers further the number of dependencies pulled from 785 to 744.

Changes:
- Added `gradle_parser.awk` script for getting dependencies from Gradle
- Changed the `deps.urls` file to contain full URLs to POMs
- Dropped the `deps.urls.old` part since `get_urls.sh` no longer exists
- Added `CLR` for learing line to `scripts/colors.sh`
- Wrote a new `nix/deps/gradle/README.md`
- Re-generated `nix/pkgs/go-maven-resolver/deps.nix`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-05-24 15:44:15 +02:00
parent 335d2434f0
commit 2f65cedd2d
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
12 changed files with 893 additions and 1434 deletions

1
.gitignore vendored
View File

@ -174,7 +174,6 @@ conan.cmake
/.ran-setup
/.nix-gcroots/
/result
/nix/deps/gradle/deps.urls.old
# modules
status-modules/translations

View File

@ -1,10 +1,44 @@
# Maven dependencies Nix wrapper
# Description
## Overview
This directory contains the tools and the data that allows Nix to manage Gradle project dependencies for the app.
This folder contains the Nix expression (`maven-sources.nix`) that downloads all Maven dependencies required for Gradle, as well as the scripts used to generate that file, namely:
# Usage
- `generate-nix.sh`: This is the main entry point script, which will use Gradle to determine the dependencies (into `maven-inputs.txt`), and `nix/tools/maven/maven-inputs2nix.sh` to generate `default.nix` from those dependencies.
- `fetch-maven-deps.sh`: This script does the heavy work of determining Gradle dependencies and outputting a `maven-inputs.txt` file listing the external URLs.
- `reactnative-android-native-deps.nix`: Contains the Nix attribute set used to download the React Native dependencies used in React Native Gradle scripts.
- `maven-inputs.txt`: A list of Maven dependenciy URLs that can be used by `nix/tools/maven/maven-inputs2nix.sh` to generate `maven-sources.nix`.
Simply calling `generate.sh` should result in a `deps.json` file which is used in the derivation that provides Gradle dependencies when building the Android app.
You can see in [`nix/mobile/android/release.nix`](../../mobile/android/release.nix) that it's used via the `-Dmaven.repo.local='${deps.gradle}'` Gradle flag.
# Files
First we have the files that store data on Gradle dependencies:
* `proj.list` - List of projects of which our Gradle project consists.
* `deps.list` - List of dependencies for our project and sub-projects.
* `deps.urls` - List of URLs to POMs for all of the dependencies.
* `deps.json` - Final file containing all of the necessary data for Nix.
Generating scripts:
- `generate.sh` - Main script which generates all the above files.
- `get_projects.sh` - Calls Gradle to get a list of sub-projects.
- `get_deps.sh` - Calls Gradle to get all the dependencies of sub-projects.
- `gradle_parser.awk` - An AWK script that parses above Gradle output.
- `url2json.sh` - Converts the list of URLs into a format consumable by Nix.
Finally we have the Nix derivation in `default.nix` which produces a derivation with all of the Gradle project dependencies:
```
$ nix-build --no-out-link --attr pkgs.deps.gradle default.nix
/nix/store/57g95ik19k6gs5w68yid3hzhsax60i3m-status-react-maven-deps
$ ls -l /nix/store/57g95ik19k6gs5w68yid3hzhsax60i3m-status-react-maven-deps | head -n 5
total 32
dr-xr-xr-x 3 root root 3 Jan 1 1970 android
dr-xr-xr-x 35 root root 35 Jan 1 1970 androidx
dr-xr-xr-x 15 root root 15 Jan 1 1970 com
dr-xr-xr-x 3 root root 3 Jan 1 1970 commons-cli
...
```
# Dependencies
One dependency these scripts require is the [go-maven-resolver](https://github.com/status-im/go-maven-resolver) which turns a list of packages into list of all URLs of POMs for them and their dependencies.

View File

@ -1,18 +1,4 @@
[
{
"path": "androidx/activity/activity/1.0.0-rc01/activity-1.0.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "05bfab882943363153ae9eefbaba3c6065f43922",
"sha256": "1dlf3ns37d72wlxkj8dzhygvjy00614mx2hm6yh9a4c238afrb33"
},
"jar": {
"sha1": "3339ce77cea7349781e82681a532b671ea7dde59",
"sha256": "18489x5f0ch468vkqa05m1cmymg0adcxnmldxkn7zp7gg84kwy6d"
}
},
{
"path": "androidx/activity/activity/1.0.0/activity-1.0.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -111,20 +97,6 @@
}
},
{
"path": "androidx/appcompat/appcompat-resources/1.1.0-rc01/appcompat-resources-1.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "ede5b258a8f866119f39a17a2daf749e76be42a6",
"sha256": "16n4b8cpqh5xjgfkj39mjw8f26ngkb1151m6b21wxb3fdh90mnh9"
},
"jar": {
"sha1": "1c8796ad736cbcb539e89630931ca886b2e75212",
"sha256": "1dxgnr7j3b94lzsyilci620902yc5rfvizp6ddy43xlzi7ypfyb3"
}
},
{
"path": "androidx/appcompat/appcompat-resources/1.1.0/appcompat-resources-1.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -139,20 +111,6 @@
}
},
{
"path": "androidx/appcompat/appcompat/1.0.0/appcompat-1.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "5ce716d352f95b3c0ea0ecf9f579691c1a79410f",
"sha256": "0asdria39qs9hf18wwpm11pp2bqvwzci9pr75lpb4ch8p36kyb10"
},
"jar": {
"sha1": "155b5a7193b5b87c3ece2ec444c85cd8de2347dd",
"sha256": "1kjndp9mip46205znb028ngi7vrvpkca8698dcrd7jrn43hm8hlr"
}
},
{
"path": "androidx/appcompat/appcompat/1.0.2/appcompat-1.0.2",
"host": "https://dl.google.com/dl/android/maven2",
@ -167,20 +125,6 @@
}
},
{
"path": "androidx/appcompat/appcompat/1.1.0-rc01/appcompat-1.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "49c937cd4c8edaa42aefa8eb7b9adffc3c5362c3",
"sha256": "0gy1y4rw48iljrii6hg34lh9ydb2m8filvych6rmlsy7j5dgps7x"
},
"jar": {
"sha1": "62955e0a3c6f4566648f30da6e40e44b01221422",
"sha256": "0kv75gf28rm5xbh8dxsaz4vkiz8s5am5bcdxka92wkyv4hx3n4cm"
}
},
{
"path": "androidx/appcompat/appcompat/1.1.0/appcompat-1.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -223,20 +167,6 @@
}
},
{
"path": "androidx/arch/core/core-common/2.1.0-rc01/core-common-2.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "jar",
"pom": {
"sha1": "ee73e3edda236d1e1114b333d4e7dfac924c3f79",
"sha256": "13yxa5zhxgmsjlfvmwzccafqw57v6zqar11kkmypx3kkz1vmnlh6"
},
"jar": {
"sha1": "b3152fc64428c9354344bd89848ecddc09b6f07e",
"sha256": "129qclk47ifk57y8d135lfqchx7gffpswfgy55zkw1lx0azkf4py"
}
},
{
"path": "androidx/arch/core/core-common/2.1.0/core-common-2.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -587,20 +517,6 @@
}
},
{
"path": "androidx/fragment/fragment/1.1.0-rc01/fragment-1.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "6cab14f710c74d04aef6f4b34b734fdc5db014b5",
"sha256": "1mf7zxckhc6kz38za5l7jllhnk06z6f0bw8nch1krdm667g8rglc"
},
"jar": {
"sha1": "5369151f89369269c30897029bed5cf258509f60",
"sha256": "1gmb7hw470lf5ra2f0bky6fzg5l6yhnps1vkhl18hg7iw3p27xba"
}
},
{
"path": "androidx/fragment/fragment/1.1.0/fragment-1.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -699,20 +615,6 @@
}
},
{
"path": "androidx/lifecycle/lifecycle-common/2.1.0-rc01/lifecycle-common-2.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "jar",
"pom": {
"sha1": "3787cc1eed8c7e6a822fa60215549387e4a0ccce",
"sha256": "1yccdg9fwjq9szl8gjf1lj463bwc44sicr7yqf1ia1pad1df0fga"
},
"jar": {
"sha1": "c67e7807d9cd6c329b9d0218b2ec4e505dd340b7",
"sha256": "0hr610gzh7k0hbd4fs3l4hl9bn965hmb3zn2c6rhywxx6gjnpnvn"
}
},
{
"path": "androidx/lifecycle/lifecycle-common/2.1.0/lifecycle-common-2.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -797,20 +699,6 @@
}
},
{
"path": "androidx/lifecycle/lifecycle-runtime/2.1.0-rc01/lifecycle-runtime-2.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "37d279635d4095bc4a11c476399154343e8f76cb",
"sha256": "08p1vj6cskw9hw2q5ihqjf7mj8h6s5fjilb6h3090zw41kqs4qng"
},
"jar": {
"sha1": "9adcac4dbf51391798e5dbeb1c414408d7ff6558",
"sha256": "06hj3ba63nacbg8xb0w061k8jpb92adr336cniwz0kr8v0igyggv"
}
},
{
"path": "androidx/lifecycle/lifecycle-runtime/2.1.0/lifecycle-runtime-2.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -881,20 +769,6 @@
}
},
{
"path": "androidx/lifecycle/lifecycle-viewmodel/2.1.0-rc01/lifecycle-viewmodel-2.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "de93bcc0e90b4d795415dc2435de27e51d38f440",
"sha256": "1i1lz9mqhkds8mz5rm379dj1cmv2717xn935xg4l5930q7007xb5"
},
"jar": {
"sha1": "b55fd435828b78efe4866ed28bb922161597c7ac",
"sha256": "0irv973bbs8h2yfhmla9q51h4cix9qlcfmczcxv2h43hddv82cv3"
}
},
{
"path": "androidx/lifecycle/lifecycle-viewmodel/2.1.0/lifecycle-viewmodel-2.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1021,20 +895,6 @@
}
},
{
"path": "androidx/savedstate/savedstate/1.0.0-rc01/savedstate-1.0.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "7cff5957aca1ee17fc49b1d6601b8e3dccf67dde",
"sha256": "1y07qbzcb61gyv4rhj1jn8dyz6xb8yy7y63d9i2vkias7f1mvgjg"
},
"jar": {
"sha1": "8b8f9e98e359be8d0466c15a682ba246100e3edc",
"sha256": "0nvxcsn2q421vvh00mz1wb4fwpbc37n7yhzx5zz26xhddyx07m9c"
}
},
{
"path": "androidx/savedstate/savedstate/1.0.0/savedstate-1.0.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1133,20 +993,6 @@
}
},
{
"path": "androidx/vectordrawable/vectordrawable-animated/1.1.0-rc01/vectordrawable-animated-1.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "0306fff46604ec21f43f2953c85351e82785cf77",
"sha256": "16b9agvavir580pq21p9k82mnksnvn4avslk6i811vdl9cna1mnj"
},
"jar": {
"sha1": "d574d647c1305a96791edaf097f04fe4fc6db5f5",
"sha256": "1yg6vqcrjvp8jn569gr3240r9i5ihdx0vvbx349fs27ip3q0vch1"
}
},
{
"path": "androidx/vectordrawable/vectordrawable-animated/1.1.0/vectordrawable-animated-1.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1189,20 +1035,6 @@
}
},
{
"path": "androidx/vectordrawable/vectordrawable/1.1.0-rc01/vectordrawable-1.1.0-rc01",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "c1ffad7b1e9fac67051c8d56c5e7db6a59fbfc50",
"sha256": "1hmbz5id23qib51f43c8x6mzad969dwq7q2x00l4f6dv0b6n8whv"
},
"jar": {
"sha1": "b3612e242f283b5cc510b842997bf20daf7345ec",
"sha256": "1aa28n46c7bh0axmjdgacidb8mah5s4nyjdzksw436scmwihwqnh"
}
},
{
"path": "androidx/vectordrawable/vectordrawable/1.1.0/vectordrawable-1.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1315,20 +1147,6 @@
}
},
{
"path": "android/arch/core/common/1.1.1/common-1.1.1",
"host": "https://dl.google.com/dl/android/maven2",
"type": "jar",
"pom": {
"sha1": "5cc390dbeaacc19fe0965f74409118d2dfacce9e",
"sha256": "0p0ayl1vfry0j38gxf5vcm333pzdsli2mc485wwgmiycxazar4gb"
},
"jar": {
"sha1": "e55b70d1f5620db124b3e85a7f4bdc7bd48d9f95",
"sha256": "06hm9hgzw9bn7ck0clp878yn24xh65f5ff3balzy5s9kyhr6lq9s"
}
},
{
"path": "android/arch/core/runtime/1.1.0/runtime-1.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1343,20 +1161,6 @@
}
},
{
"path": "android/arch/core/runtime/1.1.1/runtime-1.1.1",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "cc16795b4f119cce855c9b0c3898cc99d1c7677a",
"sha256": "1ack26gzb0r0nsp9x1rq880d7x5309z0v8k02j05s21d2jck0i9h"
},
"jar": {
"sha1": "a7e27caf787e14c0d8417be907f4a31f0306acb2",
"sha256": "0fawl29pzici28z8rpi7q4drg2dd4ly4lkkgibwb649khyjml8f3"
}
},
{
"path": "android/arch/lifecycle/common/1.0.0/common-1.0.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1385,20 +1189,6 @@
}
},
{
"path": "android/arch/lifecycle/common/1.1.1/common-1.1.1",
"host": "https://dl.google.com/dl/android/maven2",
"type": "jar",
"pom": {
"sha1": "92d7cbcfe8e43586172bf0ffe809fff9c57cf556",
"sha256": "10jf7gl280lk1mfkypkq7chp9jz433gil68iz0kfl1id497yfhhp"
},
"jar": {
"sha1": "207a6efae6a3555e326de41f76bdadd9a239cbce",
"sha256": "0mpz3jwbh7riw9h637aima8gss68294428znxq4rw66mxf48wdwd"
}
},
{
"path": "android/arch/lifecycle/livedata-core/1.1.0/livedata-core-1.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1413,34 +1203,6 @@
}
},
{
"path": "android/arch/lifecycle/livedata-core/1.1.1/livedata-core-1.1.1",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "7df0f1b6e3af11086bbc1e803560483c6c817c8a",
"sha256": "18g29x8wn7pk8fcxjdkx1qh5kgnpb3my2f25p36nxjfmbzc1r8b7"
},
"jar": {
"sha1": "30ede25cb577323f039c2e3d72b3b56526a2b2e6",
"sha256": "0l1cq4y8vq39ghb46kdp6vlvxwc39si8csgil9z8s5ynhnwxizfn"
}
},
{
"path": "android/arch/lifecycle/livedata/1.1.1/livedata-1.1.1",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "b4b4d001ca961adb29783cfcdb61c36f877c51bf",
"sha256": "0vl53g5ycr4130pljpyl9wcywrn03jlk71f3fim636kk71kk1nz8"
},
"jar": {
"sha1": "82e0b1bf2dc8ce23898cf433cc150df7b3dba952",
"sha256": "0l6ppjhw9vq0k7rj9m0ddna8h208ifck4h2m9vxpq6pzq6809ash"
}
},
{
"path": "android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1469,20 +1231,6 @@
}
},
{
"path": "android/arch/lifecycle/runtime/1.1.1/runtime-1.1.1",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "a03da450cdabd1a202c603bd7476a2e06b1320c0",
"sha256": "14p5qzqss25nh4h71zxkk53klwrc8ywk62a7dn5ivhnnm71d79y7"
},
"jar": {
"sha1": "4286e1ae9364b485cb2ff7a370e355b7c570015b",
"sha256": "0l75r941m4qjyalz4szrw3vi6h713m74aw9mb7napw5jq5kbxr64"
}
},
{
"path": "android/arch/lifecycle/viewmodel/1.1.0/viewmodel-1.1.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1497,20 +1245,6 @@
}
},
{
"path": "android/arch/lifecycle/viewmodel/1.1.1/viewmodel-1.1.1",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "12c7545bef90f1f99fa58d76c7883f98aa566d86",
"sha256": "0m85hkqkqcld7pawm77bd62xb4fm69g0bx5skwqxn5qxxqc2bbny"
},
"jar": {
"sha1": "897b6e22c8357b23ab0c7600c961549c098f5ccf",
"sha256": "0sn95f71y7ds4apl2fg6hz85009dh7v5fk13pvavbmkppbx9rqkx"
}
},
{
"path": "com/android/databinding/baseLibrary/3.0.0/baseLibrary-3.0.0",
"host": "https://dl.google.com/dl/android/maven2",
@ -1651,20 +1385,6 @@
}
},
{
"path": "com/android/support/animated-vector-drawable/28.0.0/animated-vector-drawable-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "c22c9ae3b30ed1d7098aca477c5ccc7679e69f4e",
"sha256": "1jpcjm59larpmd7p99frsbj8z0kfy3crzyl6jjskq6avrsf3yy6l"
},
"jar": {
"sha1": "e2d41c2a032145313f42ab38a2d9757c5d1ebc19",
"sha256": "1dxkiz8nz3ipdihnz04w32j0hd4w29rh9fjmwvcxra6d0v4wn7i7"
}
},
{
"path": "com/android/support/appcompat-v7/26.0.2/appcompat-v7-26.0.2",
"host": "https://dl.google.com/dl/android/maven2",
@ -1707,174 +1427,6 @@
}
},
{
"path": "com/android/support/appcompat-v7/28.0.0/appcompat-v7-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "ab02e68f7b1362ef629f5e25bc412db5b92d1cc2",
"sha256": "05syijvlcpdvzgzsmgvhmr0v7icyx8njj3acd58vdcga6ziapwnr"
},
"jar": {
"sha1": "132586ec59604a86703796851a063a0ac61f697b",
"sha256": "0lhp66q8rxf8cxylr8g6qjqy6s26prgrnmq133cnwx2r0ciyba53"
}
},
{
"path": "com/android/support/asynclayoutinflater/28.0.0/asynclayoutinflater-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "e773fa88d9f5ae46f3e71bb942a97bdc3531c275",
"sha256": "0y3f3jqqn35fjcqpz94hdwzid8rz8aszbfj0zdd5v9n1lw61s3vr"
},
"jar": {
"sha1": "3ae7643d120e6da3adbe2d698de923f48c904d1f",
"sha256": "18hs6pf9afsmn32i0h7knwdsz63wvmh5ywqckdbk8wqzfa3xwnqi"
}
},
{
"path": "com/android/support/collections/28.0.0/collections-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "jar",
"pom": {
"sha1": "24fa6fc0c382f329fd572c9dd6ca30598aec1679",
"sha256": "1fi7rz03l8s4dy7fycxb9y5skljrxlliqba0f4lyaa90idmi9i7n"
},
"jar": {
"sha1": "c1bcdade4d3cc2836130424a3f3e4182c666a745",
"sha256": "1w6ly8l5d1dhan3cn4cb6h7dmxpqq119g0jkfqk1llwzl345ihlk"
}
},
{
"path": "com/android/support/coordinatorlayout/28.0.0/coordinatorlayout-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "3f90fe50dd83481187803d7b7f295eca55e2cd9f",
"sha256": "0kqs6r9mf5r0pca9v9h2pgsz8gmq31d9cgnlnbvxm09gd16ng0yb"
},
"jar": {
"sha1": "7a708aac3443762e58e84368040a6a23b2c63545",
"sha256": "14iqin45d9krgqvif97bkwjlcg2lxv087vdsiw27kj9x8a0cvylx"
}
},
{
"path": "com/android/support/cursoradapter/28.0.0/cursoradapter-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "ee60adb53344c2479c57078be8e7351efcd35504",
"sha256": "0nr7bzjpyghhl3xxmily1w35vm888ncw0ma6yzlbqmw3w8y109sp"
},
"jar": {
"sha1": "d803f573799e6cd2db8839e2a70fe6ad67e86b79",
"sha256": "088dz6nhch7c0q9sviri5rknmgrq91bbwfl3m6l2rmmq8bkzzzl7"
}
},
{
"path": "com/android/support/customview/28.0.0/customview-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "89f073c97f9d118561f36badc59d05c1e73a5939",
"sha256": "1r8hf0r4jhh4hbrm4lpank7dbfk7v8a8snb3b7dzh7nmvwljfz0q"
},
"jar": {
"sha1": "423fe0f417f2f8d9c718c2cf73f9253da43f1f11",
"sha256": "0aq79rlhy3whfa9fqla2z5q2x8fa1kzw20gpicj0hklrby207nwq"
}
},
{
"path": "com/android/support/documentfile/28.0.0/documentfile-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "b4e17b5306710bef527eb999b74cd1596f722e78",
"sha256": "1flw7ynsp1x2hbh7ihki49x784gv0w2c19m9z1ij85adwf9sdzaz"
},
"jar": {
"sha1": "1187e4a23ff6250b096249c734bdabf5403c6ba9",
"sha256": "0ya7bnmiyycp3svjciyspgcvpfh3bix4h19zj9jb1dq2jczcvka7"
}
},
{
"path": "com/android/support/drawerlayout/28.0.0/drawerlayout-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "c19f2e1d602083cb79044be5b7d3763b84d7d727",
"sha256": "0dpy7imd231311x7d4gd235vzh6d1snr549lsl56xi1s985jsks2"
},
"jar": {
"sha1": "4de65d42b8e1b7f0ba40b5f35e5d4bafcd70019f",
"sha256": "02hmy66i865z6d9kxlmlvcinmbjlx489h7266w65b4s7msphjs4g"
}
},
{
"path": "com/android/support/interpolator/28.0.0/interpolator-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "d1c6242ef62233247c5f9810e8d7dfa926da594d",
"sha256": "16wzc0nzaqgqfyiq3k87m89kmlpndgssm4m0pikqzcswm9g5ysr9"
},
"jar": {
"sha1": "5d501569c8f7b667c47333a0b873aa529e0a0b9c",
"sha256": "1skp0sx38szdnsg7fzfm30hrdgfj8acfiwsn36ss8ffvl23fxivv"
}
},
{
"path": "com/android/support/loader/28.0.0/loader-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "f8c23ac6d03e41ae08a8f1324d5464dac43167d2",
"sha256": "1pz8ayarpf2magxz91ifchg3dnjny4d7b6zy0canv52bgxhav6ws"
},
"jar": {
"sha1": "49a297a4635e01ed55f31b5d4a718ba3416fde3d",
"sha256": "0h838vr12xp186km31yzqs1q9f3kzs1si20gbf8kxhrdszpqa2wj"
}
},
{
"path": "com/android/support/localbroadcastmanager/28.0.0/localbroadcastmanager-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "f078013fe477c3468b16d39296f719a8fc5cd3e2",
"sha256": "149h64rmb37i763gq20mzn9v1g4bc7agj7vby7gi64a26l9r86im"
},
"jar": {
"sha1": "5c498cb7e2fa5910d6c50e28531c55b77d6bf0f6",
"sha256": "01m8r0rdx4pxwqx38559yxx6isgg63vcbkwz14nfgpazmwiwi1yj"
}
},
{
"path": "com/android/support/print/28.0.0/print-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "b24c49ea877ee5fb066f53c5f20d23aecfd6a324",
"sha256": "0y3fkj22rlaxjnj73q963713kbbfzlhvkcdfj6yzqp2gwqadjpg1"
},
"jar": {
"sha1": "d2c60bfbbdc2eadd4ff7c8f65743fab830339743",
"sha256": "0a2p7x883k50k91vrwvbfawhngzggl9axklibgiq0jiysw9ais2b"
}
},
{
"path": "com/android/support/recyclerview-v7/27.0.1/recyclerview-v7-27.0.1",
"host": "https://dl.google.com/dl/android/maven2",
@ -1889,20 +1441,6 @@
}
},
{
"path": "com/android/support/slidingpanelayout/28.0.0/slidingpanelayout-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "a643e0ed2f476b766e863c05ecd1797361ad3d9e",
"sha256": "0696s0x8bl916j6gp0nja93lhqhk4zmcb5hm0y1xggfqiw6sqixy"
},
"jar": {
"sha1": "20468e3ec8f36dc84846ddd99ff30516f4ffd05a",
"sha256": "006nij4yqdwhks48x3075048q4lpdz3ackxrx6pajdhvdbv39lni"
}
},
{
"path": "com/android/support/support-annotations/26.0.2/support-annotations-26.0.2",
"host": "https://dl.google.com/dl/android/maven2",
@ -1959,20 +1497,6 @@
}
},
{
"path": "com/android/support/support-annotations/28.0.0/support-annotations-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "jar",
"pom": {
"sha1": "f3de3ef854e72e9b4491b0f8b9097455704f3054",
"sha256": "06h9y2fy4bi16rc242wg4l0s4w4abf3mji2z9lxgv4j404g4i1m0"
},
"jar": {
"sha1": "ed73f5337a002d1fd24339d5fb08c2c9d9ca60d8",
"sha256": "09xrjf54i4fglvzn6kccrj77r9hdmvfxbf16fppa0grdy0a98nsx"
}
},
{
"path": "com/android/support/support-compat/26.0.2/support-compat-26.0.2",
"host": "https://dl.google.com/dl/android/maven2",
@ -2029,20 +1553,6 @@
}
},
{
"path": "com/android/support/support-compat/28.0.0/support-compat-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "ededbbdbfc461c09f992371624bf7fa564748c36",
"sha256": "06ln7psm2gm6nskdj48cgd2mrzs1mlk6m0px3jb0zz4249na0ybb"
},
"jar": {
"sha1": "d252b640ed832cf8addc35ef0a9f9186dc7738a5",
"sha256": "12hi2xc9qshbdr2jw96664i3va9wj0pjjhv9r2hrwgzavc0knzp1"
}
},
{
"path": "com/android/support/support-core-ui/26.0.2/support-core-ui-26.0.2",
"host": "https://dl.google.com/dl/android/maven2",
@ -2099,20 +1609,6 @@
}
},
{
"path": "com/android/support/support-core-ui/28.0.0/support-core-ui-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "92fb72fc4b7dcf8ed19311acb519a8aa9ff1abbd",
"sha256": "0i5mg7k6bxq3cr062n72y3lgwhalmqjhdzcmwfp2brlcljkd92kh"
},
"jar": {
"sha1": "96035b1030d7c3a81903966c2fa52117d36aa5b7",
"sha256": "0vvc9dbpxwmvlbdbmhs9nzrzkd9aadhk6dxg6d3lcjanr5gzdixv"
}
},
{
"path": "com/android/support/support-core-utils/26.0.2/support-core-utils-26.0.2",
"host": "https://dl.google.com/dl/android/maven2",
@ -2169,20 +1665,6 @@
}
},
{
"path": "com/android/support/support-core-utils/28.0.0/support-core-utils-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "3c7f20edba570e68230a0dda8b1973d2fbd3963e",
"sha256": "1xzalj9zr15k3sf3lsi9y1k9msixjkfkbv6a1r6kb2wyffw499w6"
},
"jar": {
"sha1": "29b1bb783f1a86eba7f1618bad58842bde72892a",
"sha256": "0hdcj1byn1p2jwn09wdjii5kdv1an8swys9c02pfvciwrac1w7n8"
}
},
{
"path": "com/android/support/support-fragment/26.0.2/support-fragment-26.0.2",
"host": "https://dl.google.com/dl/android/maven2",
@ -2239,20 +1721,6 @@
}
},
{
"path": "com/android/support/support-fragment/28.0.0/support-fragment-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "68f1c70d7d3a075c2f4dcbfe908dd112068bc11c",
"sha256": "01wvhrvkzpnzdp3a6qanrdhxzg221zxakvcvsf16pckpbggdljyj"
},
"jar": {
"sha1": "f21c8a8700b30dc57cb6277ae3c4c168a94a4e81",
"sha256": "05d9hws2xvwmvsqrsb7yviyppmnvqfbz3cx4l55q51nsi9rzqwip"
}
},
{
"path": "com/android/support/support-media-compat/26.0.2/support-media-compat-26.0.2",
"host": "https://dl.google.com/dl/android/maven2",
@ -2351,62 +1819,6 @@
}
},
{
"path": "com/android/support/support-vector-drawable/28.0.0/support-vector-drawable-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "c591e6355f4f464473cc389544840b9426623dcb",
"sha256": "1p5a698pp2m1v95dic2vi4f33yawiy0a3glvn16jgwdh89hl2m0y"
},
"jar": {
"sha1": "80387886ef55af284d8253e52d321f93b3f923dd",
"sha256": "0k9z6z66j41k9lg8ccz1wl7phl30r5qq8mr8xp7vqwl1jrnrhn7n"
}
},
{
"path": "com/android/support/swiperefreshlayout/28.0.0/swiperefreshlayout-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "38d38af71b3f552cb2daefcc1fce37682d22b048",
"sha256": "0bw7vicqv28a4zr7m4347ysybxrhr082bq0by92ai62xnwr8vq62"
},
"jar": {
"sha1": "bfa669303f0ac8a83d9c878fafadc2936625f781",
"sha256": "04p74n9mzzxj1wq39xb5jxlmhj4dk2gy91jyhr4np1ihcxzizd53"
}
},
{
"path": "com/android/support/versionedparcelable/28.0.0/versionedparcelable-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "c95ed52768492e6352cce0d2c63f71b25a636729",
"sha256": "0ys472g4y9yir0vysg10z76mm7sh5zgq8qmbiyciid02wwkggmp7"
},
"jar": {
"sha1": "90432a1e322e0e0bad2116dff0e64c708514808f",
"sha256": "00lxij88dcwimjrfbq96w6sk0ngbxc1mw4r3c4zmrdkiiyq1rsv0"
}
},
{
"path": "com/android/support/viewpager/28.0.0/viewpager-28.0.0",
"host": "https://dl.google.com/dl/android/maven2",
"type": "aar",
"pom": {
"sha1": "706d9194dbaeb893abd58110396e980375e2d282",
"sha256": "03j317s53pczpz4lq9r7l0147b57nbng8fs4myrak97nfdjvl2q8"
},
"jar": {
"sha1": "f513ecf69dfea8b60987bd3e869970300ba7c0eb",
"sha256": "1z2zwf155zqmgn9qpfj2wggpb7qmb2z71sds9l8fqn470m9lqg01"
}
},
{
"path": "com/android/tools/analytics-library/crash/26.2.1/crash-26.2.1",
"host": "https://dl.google.com/dl/android/maven2",
@ -7261,6 +6673,20 @@
}
},
{
"path": "com/squareup/okio/okio/2.7.0-alpha.lockfree.1/okio-2.7.0-alpha.lockfree.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "jar",
"pom": {
"sha1": "93f841606965109787a468e49a38c3e1031599e0",
"sha256": "1nnjv05r7x044ryh0dnsvib6220wqjbbxv3xxq68qjvq22yzq2nn"
},
"jar": {
"sha1": "a025f03782f6c1aec46c151da0c0add297010f61",
"sha256": "0s7k48i95qqpqixs46xibzd7gw74d1a74m5m4939crjwjz4gkn86"
}
},
{
"path": "com/sun/activation/all/1.2.0/all-1.2.0",
"host": "https://repo.maven.apache.org/maven2",

View File

@ -2,10 +2,8 @@ androidx.activity:activity:1.1.0
androidx.annotation:annotation:1.0.0
androidx.annotation:annotation:1.1.0
androidx.appcompat:appcompat-resources:1.1.0
androidx.appcompat:appcompat:1.0.0
androidx.appcompat:appcompat:1.0.2
androidx.appcompat:appcompat:1.1.0
androidx.appcompat:appcompat:1.1.0-rc01
androidx.arch.core:core-common:2.0.0
androidx.arch.core:core-common:2.1.0
androidx.arch.core:core-runtime:2.0.0
@ -87,9 +85,6 @@ com.android.databinding:compilerCommon:1.0-rc5
com.android.databinding:compilerCommon:2.2.3
com.android.databinding:compilerCommon:3.0.0
com.android.databinding:compilerCommon:3.0.1
com.android.support:appcompat-v7:28.0.0
com.android.support:appcompat-v7:androidx.appcompat:appcompat:1.0.2
com.android.support:appcompat-v7:androidx.appcompat:appcompat:1.1.0
com.android.tools.analytics-library:crash:26.2.1
com.android.tools.analytics-library:crash:26.3.1
com.android.tools.analytics-library:crash:26.5.3
@ -316,7 +311,6 @@ com.facebook.fresco:nativeimagefilters:2.0.0
com.facebook.fresco:nativeimagetranscoder:2.0.0
com.facebook.fresco:stetho:2.0.0
com.facebook.infer.annotation:infer-annotation:0.11.2
com.facebook.react:react-native:0.62.2
com.facebook.soloader:annotation:0.8.0
com.facebook.soloader:annotation:0.8.2
com.facebook.soloader:nativeloader:0.8.0

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e
if [[ -z "${IN_NIX_SHELL}" ]]; then
echo "Remember to call 'make shell'!"
exit 1
@ -37,24 +39,14 @@ echo -e "Found ${GRN}$(wc -l < ${PROJ_LIST})${RST} sub-projects..."
# Check each sub-project in parallel, the ":" is for local deps ---------------
PROJECTS=$(cat ${PROJ_LIST})
${CUR_DIR}/get_deps.sh ":" ${PROJECTS[@]} \
| sort -uV -o ${DEPS_LIST}
${CUR_DIR}/get_deps.sh ":" ${PROJECTS[@]} | sort -uV -o ${DEPS_LIST}
echo -e "\033[2KFound ${GRN}$(wc -l < ${DEPS_LIST})${RST} direct dependencies..."
# Save old URLs file to improve search
if [[ ! -s "${DEPS_URLS}.old" ]] && [[ -s "${DEPS_URLS}" ]]; then
mv "${DEPS_URLS}" "${DEPS_URLS}.old"
fi
echo -e "${CLR}Found ${GRN}$(wc -l < ${DEPS_LIST})${RST} direct dependencies..."
# Find download URLs for each dependency --------------------------------------
# The AWK call removes duplicates using different repos.
cat ${DEPS_LIST} \
| go-maven-resolver \
| sed 's/.pom$//' \
| sort -uV -o ${DEPS_URLS}
cat ${DEPS_LIST} | go-maven-resolver | sort -uV -o ${DEPS_URLS}
echo -e "\033[2KFound ${GRN}$(wc -l < ${DEPS_URLS})${RST} dependency URLs..."
echo -e "${CLR}Found ${GRN}$(wc -l < ${DEPS_URLS})${RST} dependency URLs..."
# Open the Nix attribute set --------------------------------------------------
echo -n "[" > ${DEPS_JSON}
@ -72,5 +64,6 @@ sed -i '$ s/},/}/' ${DEPS_JSON}
# Close the Nix attribute set
echo "]" >> ${DEPS_JSON}
echo -e "\033[2KGenerated Nix deps file: ${DEPS_JSON}"
REL_DEPS_JSON=$(realpath --relative-to=${PWD} ${DEPS_JSON})
echo -e "${CLR}Generated Nix deps file: ${REL_DEPS_JSON#../}"
echo -e "${GRN}Done${RST}"

View File

@ -6,13 +6,7 @@ GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
# Gradle needs to be run in 'android' subfolder
cd $GIT_ROOT/android
# AWK script to catch only non-test deps
AWK_SCRIPT='
/^(classpath|[a-zA-Z]+ - .*)$/{
if ($1 ~ "test") { next; }
while ($0!="") { print; getline; }
}
'
AWK_SCRIPT="${GIT_ROOT}/nix/deps/gradle/gradle_parser.awk"
# Run the gradle command for a project:
# - ':buildEnvironment' to get build tools
@ -38,13 +32,4 @@ done
./gradlew --no-daemon --console plain \
"${BUILD_DEPS[@]}" \
"${NORMAL_DEPS[@]}" \
| awk "${AWK_SCRIPT}" \
| grep -e '[\\\+]---' \
| sed -E 's;.*[\\\+]--- ([^ ]+:)(.+ -> )?([^ ]+).*$;\1\3;' \
| grep --invert-match -E \
-e '^[a-z]+$' \
-e '^:?[^:]+$' \
-e '--- project :' \
-e '^(#|status-im:)' \
-e '(\+|unspecified)$' \
-e '^[^+].+ \([\*n]\)$'
| awk -f ${AWK_SCRIPT}

View File

@ -0,0 +1,54 @@
# This script parses the AWFUL Gradle output of :dependencies calls
# and outputs just the names of the packages in the Maven format:
# <groupId>:<artifactId>:<version>
function findPackage(line, regex) {
rval = match(line, regex, matches)
if (rval != 0) {
dep = sprintf("%s:%s:%s", matches[1], matches[2], matches[3])
if (deps[dep] == nil) {
deps[dep] = 1
}
return 1
}
return 0
}
# Gradle outputs dependencies in groups defined by configurations.
# Those configurations are words followed by a dash and a description.
# There's also a special 'classpath' configuration we want.
/^(classpath|[a-zA-Z]+)( - .*)?$/ {
# Ignore configurations starting with 'test'
if (tolower($1) ~ /^test/) {
next
}
# Lines after configuration name list packages
for (getline line; line != ""; getline line) {
# React Native is provided by node_modules
if (line ~ "com.facebook.react:react-native") { continue }
# Example: +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50
if (findPackage(line, "--- ([^:]+):([^:]+):([^ ]+)$")) {
continue
}
# Example: +--- androidx.lifecycle:lifecycle-common:{strictly 2.0.0} -> 2.0.0 (c)
if (findPackage(line, "--- ([^:]+):([^:]+):[^ ]+ -> ([^: ]+) ?(\\([*c]\\))?$")) {
continue
}
# Example: +--- com.android.support:appcompat-v7:28.0.0 -> androidx.appcompat:appcompat:1.0.2
if (findPackage(line, "--- [^:]+:[^:]+:[^ ]+ -> ([^:]+):([^:]+):([^ ]+)$")) {
continue
}
}
}
END{
# It's nicer to sort it
asorti(deps, sorted)
for (i in sorted) {
print sorted[i]
}
}

View File

@ -40,9 +40,11 @@ if [[ -z "${1}" ]]; then
exit 1
fi
OBJ_REL_URL=${1}
POM_URL=${1}
# Drop the POM extension
OBJ_REL_URL=${POM_URL%.pom}
echo -en "\033[2K - Nix entry for: ${1##*/}\r" >&2
echo -en "${CLR} - Nix entry for: ${1##*/}\r" >&2
REPO_URL=$(match_repo_url "${OBJ_REL_URL}")

View File

@ -7,8 +7,8 @@ in buildGoPackage rec {
version = strings.substring 0 7 rev;
owner = "status-im";
repo = pname;
rev = "c6f05fc28e4a9df1dc09bca1473b20eb1eec212e";
sha256 = "1lghzickfms8s0bm6qiq1xg1nz4qsv9k3vmz4d255acnydxmc893";
rev = "72b6c12ab193f59d197e7f63273ec0c079b6e3a9";
sha256 = "0r6k74716175pjy8vjz0fig2h010fabl00w114qd2wb2iwq4z3x4";
goPackagePath = "github.com/${owner}/${repo}";
goDeps = ./deps.nix;

View File

@ -1,29 +1,39 @@
# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix)
[
{
goPackagePath = "golang.org/x/crypto";
fetch = {
type = "git";
url = "https://go.googlesource.com/crypto";
rev = "c2843e01d9a2";
sha256 = "01xgxbj5r79nmisdvpq48zfy8pzaaj90bn6ngd4nf33j9ar1dp8r";
};
}
{
goPackagePath = "golang.org/x/net";
fetch = {
type = "git";
url = "https://go.googlesource.com/net";
rev = "0ba52f642ac2";
rev = "0ba52f642ac2";
sha256 = "0dhqdqaia8gj303bq38pp7d14b1d9yhzd7a38paivq4bmni5nan5";
};
}
{
goPackagePath = "golang.org/x/text";
fetch = {
type = "git";
url = "https://go.googlesource.com/text";
rev = "v0.3.0";
sha256 = "0r6x6zjzhr8ksqlpiwm5gdd7s209kwk5p4lw54xjvz10cs3qlq19";
};
}
{
goPackagePath = "golang.org/x/sys";
fetch = {
type = "git";
url = "https://go.googlesource.com/sys";
rev = "85ca7c5b95cd";
rev = "85ca7c5b95cd";
sha256 = "1504qkgbhhm4f0bhk77v2r1lj6x171ay5m79alkg78wjb5cign5l";
};
}
{
goPackagePath = "golang.org/x/text";
fetch = {
type = "git";
url = "https://go.googlesource.com/text";
rev = "v0.3.0";
sha256 = "0r6x6zjzhr8ksqlpiwm5gdd7s209kwk5p4lw54xjvz10cs3qlq19";
};
}
]

View File

@ -6,3 +6,6 @@ RED='\033[0;31m'
GRN='\033[0;32m'
BLD='\033[1m'
RST='\033[0m'
# Clear line
CLR='\033[2K'