Conversation
Could you add some functional tests ? |
actually i can't even run the here is a snippet of the log when doing
|
I guess you are using a newer version of maven. Currently maven 3.0.5 is supported. |
yea, i'm using 3.2.1. with 3.0.5 and after installing android 2.2 SDK stuff it works... only thing i found is this, but as the tests pass, i assume this is OK?
i'll try to add some tests, but be warned. i haven't done any unit testing for android yet - and not much testing at all... (SHAME ON ME!) but this might be a good start ;-) |
These warnings are OK. |
currently i have a test that tests i could try to set the intent using reflection, but i don't think that this is something that should be in a test? |
I think currently the only possibility is using reflection. In Robolectric 2.2, there is a much better way: Robolectric.buildActivity(YourActivity.class).withIntent(intent).create().get(); Unfortunately my PR 973 which is upgrading to Robolectric 2.2 is not done and not merged yet. |
it seems that reflection also does not work.
not sure why, but the what shall i/we do now? |
i added the |
The problem here that the |
there it is. i hope it is okay the way i did it. :) |
any news on this? |
my test now uses the Robolectric 2.x syntax. |
This seems very great to me. There are a lot of commits for only 5 files changed but most of them are merges of upstream changes. |
if wanted i can open a new PR that has less commits. :) |
Also read here how to squash multiple commits into one. |
I'll give it a try tomorrow. Thank you for the links. |
Ok, i think i fkd it up. :( after the rebase finished, i got 66 commits to push and 10 to pull. when i pull i get an empty as i tried to rebase instead of merge when pulling the 10 commits i'll got hit by a bunch of merge conflicts. i think i shouldn't have pushed the commits. now i have everything duplicated in the log and the merge develop commits are still there :( |
i added a new branch https://github.com/dodgex/androidannotations/tree/AfterExtraNew but no PR yet. if you got some time maybe we could try to rebase this together somehow that i can learn how it works? |
I am still afk for a week, but then i get back to this and write down the |
i opened a new PR. i hope for the next time i learned the rebasing stuff to clean a PR. sorry for the trouble |
@dodgex Can you restore you branch so i can illustrate |
done |
OK, this is messed up so i created an example project. It has two branches, a master branch and a feature_branch which is where you add a new feature to this great project. :) The feature_branch is created when the project had the initial state, then a commit added. Since the the master branch also updated, so the two branches diverged: Feature branch:
Master branch:
This is exactly the same problem that you had in this PR. Now we have to option to make the feature_branch up-to-date with the master branch. One is merging what you already done, so you created those merge commits. The other one is rebasing. In this case it means taking the patch that was introduced in the commit in the feature_branch and applying it on the top of the last commit of the master branch. The command is easy, we are on the feature_branch: git rebase master This will rewrite your commit 72ecb19 to be based on 551394b. So the log for the feature_branch looks like this:
As you can see 72ecb19 changed to 8be1f36 because the patch has now different content. Now if you switch to the feature branch again, git warns you with this message: Your branch and 'origin/feature_branch' have diverged, and have 2 and 1 different commit each, respectively. This is clear because we rewritten the commits, so the log for the remote branch and the local branch is diverged. Now we have to make sure our rebased branch is on the remote. We cannot simply run
We have to force push our local commits to the remote branch, so it is totally overwritten with our local commits:
Now the remote branch is up-to-date with the master branch, and has no annoying merge commits. :) |
okay. thank you. i think i got it :) i think i was confused by the Your branch and 'origin/feature_branch' have diverged, and have 2 and 1 different commit each, respectively. message. and did the mistake to PULL instead of force push (what is currently impossible with my git client btw -.-) i would be really thankfull if you could also do a short sample of squashing commits like
where thank you alot! :) |
I created the
We want to meld 3697963 into a30b1eb, so we have to reorder and squash. This can be done with the "interactive rebase":
I think the commands are clear. This text file should be edited and saved, and when you exit the text editor application git-rebase will read it and execute the commands in it. We have to modify the file to achieve our goal to this:
After executing this, we will get this message:
This is because we ran into a merge conflict. We can see it by running
We have to resolve the conflict, i hope you already know how to do that. Here is a small tutorial.
Edit the message as you want and exit the editor. We got another merge conflict again when git-rebase want apply to commit with the second line:
Resolve this conflict, and run
We can see the log:
|
@yDelouis This is already merged in another PR. Why do you added the |
To have only merged PRs when searching for PR with milestone 3.1. |
Ok, but the milestone is not needed here at all, since 3.1 is added to the |
this PR adds an @AfterExtras annotation, that works similar to @AfterInject, but the methods are called every time a new intent is set to the activty by setIntent(Intent intent).
this allows an activity to get notified about new intents and so new extras.
the generated code looks like this
for multiple extras and/or methods, first all extras get injected and then the methods get called.
to be useful this currently needs this code block in the activity
currently known "issues", the first call to an @AfterExtras annotated method does not yet have
@Bean
fields set. this would require to move theExtraHandler
below theBeanHandler
inAnnotationHandlers
. i don't think that this would cause any issues. but i'll open a seperate PR for this change.