# Newbie Groovy question: looking for a rule of thumb

**URL:** <https://discuss.gradle.org/t/newbie-groovy-question-looking-for-a-rule-of-thumb/17277>\
**Category:** Help/Discuss\
**Created:** [April 29, 2016, 2:03pm UTC](https://discuss.gradle.org/t/newbie-groovy-question-looking-for-a-rule-of-thumb/17277 "2016-04-29T14:03:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sc1478](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/sc1478/32/4341_2.png) [@sc1478](https://discuss.gradle.org/u/sc1478)\
**Post date:** [April 29, 2016, 2:03pm UTC](https://discuss.gradle.org/t/newbie-groovy-question-looking-for-a-rule-of-thumb/17277/1 "2016-04-29T14:03:24Z")

</div>

I’m not a newbie anymore, but some things I’ve glided by without trying to understand - just get the @#$%^ thing to work has been my mantra. Now I’d like to understand a really basic point that has annoyed me. Here is a fragment of build.gradle

```
sourceCompatibility = 1.6
targetCompatibility = 1.6
war.archiveName 'My.war'

```

The following does not work.

```
sourceCompatibility 1.6
targetCompatibility 1.6
war.archiveName 'My.war'

```

The question is, is there a rule of thumb for knowing (preferably in advance) when a property setting requires the equals operator and when it does not? In this case the sourceCompatibility and targetCompatibility properties require the equals whereas the war.archiveName does not.

---

<div class="post-metadata">

**Author:** ![Schalk\_Cronje](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/schalk_cronje/32/6511_2.png) [@Schalk\_Cronje](https://discuss.gradle.org/u/Schalk_Cronje)\
**Post date:** [April 30, 2016, 1:23pm UTC](https://discuss.gradle.org/t/newbie-groovy-question-looking-for-a-rule-of-thumb/17277/2 "2016-04-30T13:23:20Z")

</div>

Good style is to allow both, especially if lists/maps are involved. ON a task there is some code, I believe, that will redirect `taskName.propName(value)` to `taskname.setPropName(value)`.

But… `sourceCompatibility` is implemented not on a task but on `JavaPluginConvention`, which does not have any means of handling missing methods.
