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

Create a nom_build wrapper script #508

Merged
merged 1 commit into from
Mar 10, 2020
Merged

Conversation

mindhog
Copy link
Member

@mindhog mindhog commented Mar 9, 2020

nom_build is a wrapper around ./gradlew. It's purpose is to help us
deal with properties. The main problem that it is trying to solve is
that when properties are specified using -P, we don't get an error if
the property we specify isn't correct. As a result, a user or a build
agent can launch a build with unintended parameters.

nom_build consolidates all of the properties that we define into a
python script where the properties are translated to flags (actual
gradlew flags are also proxied). It also generates the property file
and warns the user if the current properties file is out of sync with
the script and includes documentation on each of the properties.


This change is Reviewable

nom_build is a wrapper around ./gradlew.  It's purpose is to help us
deal with properties.  The main problem that it is trying to solve is
that when properties are specified using -P, we don't get an error if
the property we specify isn't correct.  As a result, a user or a build
agent can launch a build with unintended parameters.

nom_build consolidates all of the properties that we define into a
python script where the properties are translated to flags (actual
gradlew flags are also proxied).  It also generates the property file
and warns the user if the current properties file is out of sync with
the script and includes documentation on each of the properties.
Copy link
Collaborator

@weiminyu weiminyu left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @mindhog and @weiminyu)


config/nom_build.py, line 273 at r1 (raw file):

parser.add_argument('--generate-gradle-properties',

Does this command always regenerate the properties file? It could be annoying if, say, I alternate between maven central and gcs for mavenUrl.


config/nom_build_test.py, line 44 at r1 (raw file):

class MyTest(unittest.TestCase):

How is this test invoked? Do we need a Graadle plugin for Python?

Copy link
Member Author

@mindhog mindhog left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @weiminyu)


config/nom_build.py, line 273 at r1 (raw file):

Previously, weiminyu (Weimin Yu) wrote…
parser.add_argument('--generate-gradle-properties',

Does this command always regenerate the properties file? It could be annoying if, say, I alternate between maven central and gcs for mavenUrl.

You need to add this flag explicitly to regenerate the properties file. If the file is different from what we expect, the tool will give a warning but will allow you to proceed.


config/nom_build_test.py, line 44 at r1 (raw file):

Previously, weiminyu (Weimin Yu) wrote…

How is this test invoked? Do we need a Graadle plugin for Python?

It is currently invoked by hand: python3 config/nom_build_test.py
but yes, we need a follow-up PR to add it to the test suite.

Copy link
Collaborator

@weiminyu weiminyu left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 4 files at r1.
Reviewable status: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @weiminyu)

@mindhog mindhog merged commit 6e12312 into google:master Mar 10, 2020
@mindhog mindhog deleted the build-script branch March 10, 2020 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants