CASSANDRASC-49: Set the copyright profile on generating idea project
Automatically add the ApacheV2 license header to new files
patch by Yifan Cai; reviewed by Dinesh Joshi for CASSANDRASC-49
diff --git a/build.gradle b/build.gradle
index 87b4d73..90bf37c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,6 +8,7 @@
}
plugins {
+ id 'idea'
id 'java'
id 'java-test-fixtures'
id 'application'
@@ -24,10 +25,7 @@
id 'com.google.cloud.tools.jib' version '2.2.0'
}
-
-
allprojects {
- apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: "com.github.spotbugs"
@@ -198,11 +196,15 @@
}
}
-task copyCodeStyle(type: Copy) {
- from "ide/idea/codeStyleSettings.xml"
+task copyIdeaSettings(type: Copy) {
+ from "ide/idea"
into ".idea"
}
+tasks.named('idea').configure {
+ dependsOn copyIdeaSettings
+}
+
// Lets copy the distributions from build/install directory to /bin and /lib
// directories to be aligned with C* distribution format
task copyDist(type: Copy) {
diff --git a/ide/idea/copyright/Apache_License_2_0.xml b/ide/idea/copyright/Apache_License_2_0.xml
new file mode 100644
index 0000000..e83c1c1
--- /dev/null
+++ b/ide/idea/copyright/Apache_License_2_0.xml
@@ -0,0 +1,6 @@
+<component name="CopyrightManager">
+ <copyright>
+ <option name="myName" value="Apache License 2.0" />
+ <option name="notice" value="Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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 http://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." />
+ </copyright>
+</component>
\ No newline at end of file
diff --git a/ide/idea/copyright/profiles_settings.xml b/ide/idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..5448281
--- /dev/null
+++ b/ide/idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+<component name="CopyrightManager">
+ <settings default="Apache License 2.0" />
+</component>
\ No newline at end of file