Skip to content

Migrated new APK size tool to OSS repository #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 26, 2018

Conversation

allisonbm92
Copy link
Contributor

No description provided.

@allisonbm92
Copy link
Contributor Author

/test check

1 similar comment
@allisonbm92
Copy link
Contributor Author

/test check

Copy link
Contributor

@ashwinraghav ashwinraghav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

*
* <p>This may be any type recognized by Gradle as a file. The format of the file's contents is
* headerless CSVwith a colon as a delimiter: projectName_buildVariant:sdkId. The first column
* contains both the project name and build variant separated by an hyphen, {@code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

underscore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a multiline example of what this would look like in practice for firebase-android-sdk would be helpful
firestore_debug:1
database_debug:1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. This is actually supposed to be a hyphen. It works for now, but we may need to change it in the future if we start have hyphens in project and build variant names.

* firestore-aggressive}, for example.
*/
@InputFile
File sdkMap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to sdkMapFile ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


private def createSdkMap() {
def map = [:]
def path = project.file(sdkMap)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be able to just say sdkMap.eachLine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yes. Originally the inputs and outputs were objects, and I relied on Gradle converting them to files. This enables strings and other types to be used in the Gradle files.

Vlad and I decided we didn't need this flexibility, but there are still some artifacts of it hanging around in the code.

@@ -0,0 +1,64 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should delete this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@allisonbm92 allisonbm92 force-pushed the allisonbm-newsizetool branch from 620316b to a4213bd Compare October 23, 2018 20:56
@allisonbm92
Copy link
Contributor Author

/test connected-check
/test smoke-tests-debug
/test smoke-tests-release

@allisonbm92
Copy link
Contributor Author

/test smoke-tests-debug

@allisonbm92 allisonbm92 force-pushed the allisonbm-newsizetool branch from a4213bd to 60419cd Compare October 24, 2018 20:25
@allisonbm92
Copy link
Contributor Author

/test build-plugins-check
/test connected-check

Copy link
Contributor

@ashwinraghav ashwinraghav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two other pieces of feedback:

  • We should probably udpate the README to reflect these changes.
  • Unit tests for the new tasks that you have up here.

def report = createReport(sizes)
// Check if we need to run human-readable or upload mode.
if (project.hasProperty("pull_request")) {
def pullRequestNumber = project.properties["pull_request"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting wierdness

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. My editor seems to be throwing tabs in... :(

reportFile.withWriter {
it.write(report)
}
private def calculateSizesForHumanReadable(variants) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to calculateHumanReadableSizes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, naming isn't always my strong suit.

@allisonbm92
Copy link
Contributor Author

I updated the README (thanks for catching that), and I'll wait for the next pull requests to add the tests, because we're in the process of switching to JSON from protocol buffers.

@allisonbm92
Copy link
Contributor Author

/test connected-check

Copy link
Contributor

@ashwinraghav ashwinraghav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work :)

</style>
-->

<!-- Base application theme. -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we get rid of this and use the default app compat theme?

import com.google.firebase.gradle.GenerateMeasurementsTask
import com.google.firebase.gradle.UploadMeasurementsTask

// Linting needs to be disabled as none of these apps are real or intended to conform to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a Github issue to enable this?

@allisonbm92 allisonbm92 merged commit 66642d0 into master Oct 26, 2018
@allisonbm92 allisonbm92 deleted the allisonbm-newsizetool branch October 26, 2018 16:27
@firebase firebase locked and limited conversation to collaborators Oct 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants