Skip to content
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

Extract GenerateProtoTask querying fields to ProtoVariant (2/3) #669

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

rougsig
Copy link
Collaborator

@rougsig rougsig commented Jan 25, 2023

Background
To prevent eager task configuration for android, we need to hide generateProtoTask from user.

Changes
Extract task variant information (sourceSetName, buildTypeName, flavorName, etc) to ProtoVariant class.
Use ProtoVariant as tags to select GenerateProtoTaskSpec for configuration.

Breaking Changes
generateProtoTask {} api have breaking changes.

// before
generateProtoTask {
  all().each { GenerateProtoTask task ->
    task.plugins {
      grpc { }
    }
    // other configuration logic
  }
}

// after
generateProtoTask {
  all { // GenerateProtoTaskSpec spec -> (implicit this, no direct access to GenerateProtoTask instance)
    plugins {
      grpc { }
    }
    // other configuration logic
  }

  // ofSourceSet, ofTest, etc have the same changes
}

Test plan
Green pipelines.

Note
Merge after #668

@rougsig rougsig changed the title Feat/643 2 Extract GenerateProtoTask querying fields to ProtoVariant (2/3) Jan 25, 2023
@rougsig
Copy link
Collaborator Author

rougsig commented Jan 25, 2023

note:
second small part for fix for #643.

Third part will be use changes from 1, 2 PR, to configure agp/other tasks lazily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant