Skip to content

Commit c0f6cd8

Browse files
committed
Revert "Template cleanup"
This reverts commit d5d5d9e.
1 parent d5d5d9e commit c0f6cd8

22 files changed

+934
-46
lines changed

.github/readme/draft-release.png

33.8 KB
Loading
42.1 KB
Loading

.github/readme/run-logs.png

70.9 KB
Loading

.github/readme/settings-secrets.png

73.4 KB
Loading

.github/readme/use-this-template.png

51.9 KB
Loading

.github/template-cleanup/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Keep a Changelog guide -> https://keepachangelog.com -->
2+
3+
# %NAME% Changelog
4+
5+
## [Unreleased]
6+
### Added
7+
- Initial scaffold created from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)

.github/template-cleanup/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# %NAME%
2+
3+
![Build](https://github.com/%REPOSITORY%/workflows/Build/badge.svg)
4+
[![Version](https://img.shields.io/jetbrains/plugin/v/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID)
5+
[![Downloads](https://img.shields.io/jetbrains/plugin/d/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID)
6+
7+
## Template ToDo list
8+
- [x] Create a new [IntelliJ Platform Plugin Template][template] project.
9+
- [ ] Verify the [pluginGroup](/gradle.properties), [plugin ID](/src/main/resources/META-INF/plugin.xml) and [sources package](/src/main/kotlin).
10+
- [ ] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html).
11+
- [ ] [Publish a plugin manually](https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html?from=IJPluginTemplate) for the first time.
12+
- [ ] Set the Plugin ID in the above README badges.
13+
- [ ] Set the [Deployment Token](https://plugins.jetbrains.com/docs/marketplace/plugin-upload.html).
14+
- [ ] Click the <kbd>Watch</kbd> button on the top of the [IntelliJ Platform Plugin Template][template] to be notified about releases containing new features and fixes.
15+
16+
<!-- Plugin description -->
17+
This Fancy IntelliJ Platform Plugin is going to be your implementation of the brilliant ideas that you have.
18+
19+
This specific section is a source for the [plugin.xml](/src/main/resources/META-INF/plugin.xml) file which will be extracted by the [Gradle](/build.gradle.kts) during the build process.
20+
21+
To keep everything working, do not remove `<!-- ... -->` sections.
22+
<!-- Plugin description end -->
23+
24+
## Installation
25+
26+
- Using IDE built-in plugin system:
27+
28+
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "%NAME%"</kbd> >
29+
<kbd>Install Plugin</kbd>
30+
31+
- Manually:
32+
33+
Download the [latest release](https://github.com/%REPOSITORY%/releases/latest) and install it manually using
34+
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
35+
36+
37+
---
38+
Plugin based on the [IntelliJ Platform Plugin Template][template].
39+
40+
[template]: https://github.com/JetBrains/intellij-platform-plugin-template
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# IntelliJ Platform Artifacts Repositories
2+
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
3+
4+
pluginGroup = %GROUP%
5+
pluginName = %NAME%
6+
pluginVersion = 0.0.1
7+
8+
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
9+
# for insight into build numbers and IntelliJ Platform versions.
10+
pluginSinceBuild = 202
11+
pluginUntilBuild = 211.*
12+
13+
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
14+
# See https://jb.gg/intellij-platform-builds-list for available build versions.
15+
pluginVerifierIdeVersions = 2020.2.4, 2020.3.4, 2021.1.1
16+
17+
platformType = IC
18+
platformVersion = 2020.2.4
19+
platformDownloadSources = true
20+
21+
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
22+
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
23+
platformPlugins =
24+
25+
# Opt-out flag for bundling Kotlin standard library.
26+
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
27+
kotlin.stdlib.default.dependency = false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = "%NAME%"
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# GitHub Actions Workflow responsible for cleaning up the IntelliJ Platform Plugin Template repository from
2+
# the template-specific files and configurations. This workflow is supposed to be triggered automatically
3+
# when a new template-based repository has been created.
4+
5+
name: Template Cleanup
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
13+
# Run cleaning process only if workflow is triggered by the non-JetBrains/intellij-platform-plugin-template repository.
14+
template-cleanup:
15+
name: Template Cleanup
16+
runs-on: ubuntu-latest
17+
if: github.event.repository.name != 'intellij-platform-plugin-template'
18+
steps:
19+
20+
# Check out current repository
21+
- name: Fetch Sources
22+
uses: actions/[email protected]
23+
24+
# Cleanup project
25+
- name: Cleanup
26+
run: |
27+
export LC_CTYPE=C
28+
export LANG=C
29+
30+
# Prepare variables
31+
NAME="${GITHUB_REPOSITORY##*/}"
32+
ACTOR=$(echo $GITHUB_ACTOR | tr '[:upper:]' '[:lower:]')
33+
SAFE_NAME=$(echo $NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]')
34+
SAFE_ACTOR=$(echo $ACTOR | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]')
35+
GROUP="com.github.$SAFE_ACTOR.$SAFE_NAME"
36+
37+
# Replace placeholders in the template-cleanup files
38+
sed -i "s/%NAME%/$NAME/g" .github/template-cleanup/*
39+
sed -i "s/%REPOSITORY%/${GITHUB_REPOSITORY/\//\\/}/g" .github/template-cleanup/*
40+
sed -i "s/%GROUP%/$GROUP/g" .github/template-cleanup/*
41+
42+
# Replace template package name in project files with $GROUP
43+
find src -type f -exec sed -i "s/org.jetbrains.plugins.template/$GROUP/g" {} +
44+
find src -type f -exec sed -i "s/Template/$NAME/g" {} +
45+
find src -type f -exec sed -i "s/JetBrains/$ACTOR/g" {} +
46+
47+
# Remove lines marked with #REMOVE-ON-CLEANUP#
48+
find . -type f -exec sed -i '/#REMOVE-ON-CLEANUP#/d' {} +
49+
50+
# Move content
51+
mkdir -p src/main/kotlin/${GROUP//.//}
52+
cp -R .github/template-cleanup/* .
53+
cp -R src/main/kotlin/org/jetbrains/plugins/template/* src/main/kotlin/${GROUP//.//}/
54+
55+
# Cleanup
56+
rm -rf \
57+
.github/readme \
58+
.github/template-cleanup \
59+
.github/workflows/template-cleanup.yml \
60+
.idea/icon.png \
61+
src/main/kotlin/org \
62+
CODE_OF_CONDUCT.md \
63+
LICENSE
64+
65+
# Run ktlint formatting
66+
./gradlew ktlintFormat
67+
68+
# Commit modified files
69+
- name: Commit files
70+
run: |
71+
git config --local user.email "[email protected]"
72+
git config --local user.name "GitHub Action"
73+
git add .
74+
git commit -m "Template cleanup"
75+
76+
# Push changes
77+
- name: Push changes
78+
uses: ad-m/github-push-action@master
79+
with:
80+
branch: main
81+
github_token: ${{ secrets.GITHUB_TOKEN }}

.idea/icon.png

4.22 KB
Loading

0 commit comments

Comments
 (0)