google / google/ground-android

[Code health] Create Android Studio template for license headers

Open
#2,523 1 comment 1 reaction 0 assignees View on GitHub
type: code health
Dominant language
Kotlin
Stars
293
Forks
149
Avg merge
1d 16h
Merged PRs (30d)
42

Description

Step 1: Create a File Template for the License Header

Open Android Studio.

Go to File > Settings (or Android Studio > Preferences on macOS).

Navigate to Editor > File and Code Templates.

Select Includes from the left-hand side.

Click on the + button to create a new template.

Name your template, for example, License Header.
Add your license text to the template.

```
/*
* Copyright ${YEAR} Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
```

Step 3: Share the Configuration with Team via GitHub
Add the following files to your version control system (Git):

.idea/fileTemplates
.idea/fileTemplates/includes
.idea/fileTemplates/code
These directories contain the file and code templates you configured.

git add .idea/fileTemplates
git commit -m "Add license header templates"
git push origin main

@shobhitagarwal1612 @sufyanAbbasi WDYT?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.