8

I have just started learning android and using the Android Studio by IntelliJ, so please bear with me if this is a very stupid question to ask.

Is there a way to have copyright notice text automatically added to source code files, by android studio IDE?

I have eclipse setup to automatically add copyright notice text at the top of my source code file, whenever it is created. So, I am expecting something similar for android studio as well.

Please note: I know that I can easily do it by write a script that can add a license text, so please don't suggest that as an answer.

Thanks for reading this question.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Moni
  • 869
  • 3
  • 9
  • 21

3 Answers3

23

In Preferences --> Copyright --> Copyright Profiles, create a profile, and replace the default text with your own custom copyright notice. You can then format it in Formatting tab.

Example: enter image description here

Then in Copyright tab, select your profile (in my example "test"), and copyright text will be added to new source files you create.

enter image description here

To add/update the copyright to existing project files, select Code -> Update Copyright from the menu bar and select the scope of files that should be updated.

Melquiades
  • 8,496
  • 1
  • 31
  • 46
  • 9
    Thank you very much for your answer. It was very helpful. Just to share what I additionally found: I also found that once I updated the copyright profile, the "Update Copyright" option in "Code" menu got enabled and I could have the copyright notice added to all existing files of my project. – Moni Jan 11 '15 at 20:43
0

Go to the preference menu and search for copyright using the search-box.

There are a bunch of options to customize it.

Nicola Ferraro
  • 4,051
  • 5
  • 28
  • 60
0

You need to first create copyright profile.

  1. Go to Settings > Copyright > Copyright profiles
  2. Go to Settings > Copyright and change the default copyright to the new one you created.

You can find more information here https://www.jetbrains.com/idea/help/copyright-profiles.html

Rohit5k2
  • 17,948
  • 8
  • 45
  • 57