# Putting my gradle scripts in \`gradle\` directory created by wrapper task?

**URL:** <https://discuss.gradle.org/t/putting-my-gradle-scripts-in-gradle-directory-created-by-wrapper-task/44389>\
**Category:** Help/Discuss\
**Created:** [December 3, 2022, 2:04am UTC](https://discuss.gradle.org/t/putting-my-gradle-scripts-in-gradle-directory-created-by-wrapper-task/44389 "2022-12-03T02:04:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kota65535](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kota65535](https://discuss.gradle.org/u/kota65535)\
**Post date:** [December 3, 2022, 2:04am UTC](https://discuss.gradle.org/t/putting-my-gradle-scripts-in-gradle-directory-created-by-wrapper-task/44389/1 "2022-12-03T02:04:47Z")

</div>

I have many \*.gradle scripts in my project root directory, so I want to put them into some directory. Is it OK to use root `gradle` directory that is created by `wrapper` task? I’m concerned that the directory may be updated or deleted by other tasks or something else.  
I’m assuming the following directory structure.

```gradle
gradle
├── script # <- my script directory
│ ├── a.gradle
│ └── b.gradle
└── wrapper
    ├── gradle-wrapper.jar
    └── gradle-wrapper.properties

```

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [December 4, 2022, 10:46pm UTC](https://discuss.gradle.org/t/putting-my-gradle-scripts-in-gradle-directory-created-by-wrapper-task/44389/2 "2022-12-04T22:46:30Z")

</div>

Generally this is perfectly fine.  
But you should strongly consider not to use script plugins.  
They often just cause more trouble than they do good.  
They partly have strange behavior due to classpath shenenigans, you cannot use the `plugins { ... ]` DSL, …

Better use precompiled script plugins.  
They can as well be in Groovy DSL and thus will look almost the same, with the exception that the `plugins { ... }` DSL is supported, and they work much better and more predictable.

---

<div class="post-metadata">

**Author:** ![kota65535](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kota65535](https://discuss.gradle.org/u/kota65535)\
**Post date:** [December 6, 2022, 7:39am UTC](https://discuss.gradle.org/t/putting-my-gradle-scripts-in-gradle-directory-created-by-wrapper-task/44389/3 "2022-12-06T07:39:23Z")

</div>

Thank you, I didn’t know about precompiled script plugins. I’ll check it out later.
