-
Notifications
You must be signed in to change notification settings - Fork 161
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 exclude rules to separate files, abstract away from Gradle. #51
Conversation
@@ -40,32 +42,39 @@ if [ -z "$BUILD_COMMAND" ]; then | |||
exit 1 | |||
fi | |||
|
|||
pushd "$PROJECT_DIR" | |||
# Read local exclude rules. | |||
LOCAL_EXCLUDE_FILE=".mainframerignorelocal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we name this files .mfignore.local
and .mfignore.remote
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking about separate folder for mainframer configs where we could place .ignorelocal, .ignoreremote and #50 .config
@@ -15,6 +15,27 @@ function property { | |||
grep "^${1}=" $PROJECT_DIR/local.properties | cut -d'=' -f2 | |||
} | |||
|
|||
function readExcludesFile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What’s wrong with rsync --exclude-from
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing, will try
@@ -40,32 +61,21 @@ if [ -z "$BUILD_COMMAND" ]; then | |||
exit 1 | |||
fi | |||
|
|||
pushd "$PROJECT_DIR" | |||
# Read exclude rules. | |||
LOCAL_EXCLUDE="$(readExcludesFile .mainframerignorelocal)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about that. What about .mainframerlocalignore
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #54. I'd vote for current names at the moment and then if we decide to move configs into a separate folder -> rename this files, names are not the point of this PR.
--exclude='**/build' \ | ||
--exclude='**/local.properties' \ | ||
--rsh "ssh" ./ "$REMOTE_BUILD_MACHINE:~/$PROJECT_DIR_NAME" | ||
eval "rsync --archive --delete --compress-level=$LOCAL_COMPRESS_LEVEL $LOCAL_EXCLUDE --rsh ssh ./ $REMOTE_BUILD_MACHINE:~/$PROJECT_DIR_NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point we can make this a function with four arguments. Not sure if it’s worth it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for now
@@ -0,0 +1,5 @@ | |||
.gradle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Samples don’t entirely repeat what we have at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, it's basic gradle
sample, not gradle-android
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gradle-android
will make more sense since our userbase mostly consists of Android developers (for now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in a separate pr.
--exclude='artifacts' \ | ||
--exclude='captures' \ | ||
--exclude='**/build' \ | ||
--exclude='**/local.properties' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remote and local excludes look very similar. .mainframerignorecommon
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's totally up to each project members
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though, ok, this looks like a valid feature, let's think about it and add later if we'll agree on it
Switched to rsync builtin I'd vote for merging as is and adding other things in separate PRs. |
Closes #19.
This allows
mainframer.sh
to support basically any build system, seesamples/gradle
for gradle example.