John "codefu" McDole 107997effa
fix: produce pom/jar files with content_hash (#172378)
fixes: #172259

The contents of the files (pom, .jar) produced by android also reference
the artifacts version number (which includes the git-hash). The flutter
recipies are just dumb re-uploaders for the content hash at the moment.
In order to change the contents, we can just update some GN files. This
has some local duplication of files, but is acceptible for now.

I've also added the content-hash as a string in the .so file and its
printed out next to the hash.

"Why is the folder name the git-hash?"

The recipies have a quirk - the logs will have you believe they upload
individual files such that "gsutil cp a.jar b.jar" would produce
"b.jar"; but that's not what's going on. The recipies recurisively
upload from the root of the temporary folder the files are copied to. At
the moment, the "Ensure" step of builder.py updates the URL path, so it
will handling uploading to the correct path, but not the file or its
contents (hence this change).

Plan for the future: at some point we can stop producing git-ref hashes.

E.g.
git-hash: dfd7318efc71019bce1665bc41c0e8c21d1344f9 content-hash:
3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7

```shell
zip_archives
└── download.flutter.io
    └── io
        └── flutter
            ├── arm64_v8a_debug
            │   └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
            │       ├── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
            │       └── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
            └── flutter_embedding_debug
                └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7-sources.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9-sources.jar
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
                    └── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
```
2025-07-19 01:35:59 +00:00
..

Flutter Engine

Setting up the Engine development environment

See here

gclient bootstrap

Flutter engine uses gclient to manage dependencies.

If you've already cloned the flutter repository:

  1. Copy one of the engine/scripts/*.gclient to the root folder as .gclient:
    1. Googlers: copy rbe.gclient to enable faster builds with RBE
    2. Everyone else: copy standard.gclient
  2. run gclient sync from the root folder