Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Dec 3, 2024
0 parents commit 9b859de
Show file tree
Hide file tree
Showing 71 changed files with 2,002 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build pull request

on: pull_request

jobs:
build-pull-request:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
- run: |
./gradlew build
36 changes: 36 additions & 0 deletions .github/workflows/publish-pages-with-writerside.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish documentation

on:
push:
branches: ["main"]
workflow_dispatch:

env:
INSTANCE: 'Writerside/doc'
ARTIFACT: 'webHelpDOC2-all.zip'
DOCKER_VERSION: '242.21870'

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
with:
fetch-depth: 0

- uses: JetBrains/writerside-github-action@5a6920dbce3ef3169acbeb7e45c6cbdaf7e76bfa #v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
- run: |
export JAVA_HOME=$JAVA_HOME_21_X64 # Remove when ubuntu-latest updates to Java 21
./gradlew librarianStaticContent
unzip artifacts/webHelpDOC2-all.zip -d build/static
- uses: JamesIves/github-pages-deploy-action@94f3c658273cf92fb48ef99e5fbc02bd2dc642b2 #v4.6.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/static # The folder the action should deploy.
27 changes: 27 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish release

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
publish-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
with:
# See https://github.com/cli/cli/issues/9558
ref: ${{ github.ref }}
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
- run: |
./gradlew librarianPublishToMavenCentral
gh release create $GITHUB_REF_NAME --title $GITHUB_REF_NAME --verify-tag --notes-from-tag
env:
LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.LIBRARIAN_SONATYPE_USERNAME }}
LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.LIBRARIAN_SONATYPE_PASSWORD }}
LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY }}
LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD }}
GH_TOKEN: ${{ github.token }}
19 changes: 19 additions & 0 deletions .github/workflows/publish-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish snapshot

on:
push:
branches: [ main ]
jobs:
publish-snapshot:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
- run: |
./gradlew librarianPublishToSnapshots
env:
LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.LIBRARIAN_SONATYPE_USERNAME }}
LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.LIBRARIAN_SONATYPE_PASSWORD }}
LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY }}
LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD }}
25 changes: 25 additions & 0 deletions .github/workflows/tag-and-bump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tag and bump

on:
workflow_dispatch:
inputs:
versionToRelease:
description: 'The version to release'
required: true
type: string

jobs:
tag-and-bump:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- uses: gradleup/librarian/tag-and-bump@2cdb4fa8a36657aec1b52d2c5ec836f04713a80c #v0.0.4
with:
versionToRelease: ${{ inputs.versionToRelease }}
# Trigger a workflow manually because actions cannot trigger workflows to avoid endless loops
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
- run: |
gh workflow run publish-release.yaml --ref v${{ inputs.versionToRelease }}
env:
GH_TOKEN: ${{ github.token }}
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.kotlin
.fleet
.gradle

# Build outputs
build

# Idea
**/.idea/*
!**/.idea/codeStyles
!**/.idea/icon.png
!**/.idea/runConfigurations
!**/.idea/scopes
!**/.idea/dictionaries
*.iml

# Place where the Android SDK path is set
local.properties

# XCode
xcuserdata
project.xcworkspace

# Mac OS Finder
.DS_Store
Thumbs.db

18 changes: 18 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Next version (unreleased)

Initial release 🎉
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

__COPYRIGHT_LINE__

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## salty

When you can't desugar, add salt!

A Gradle plugin that inspects your bytecode to detect bad functions that are not safe to use on older Android versions.

See https://youtrack.jetbrains.com/issue/KT-71375
See https://jakewharton.com/kotlins-jdk-release-compatibility-flag/

## Usage

Add the plugin:

```kotlin
plugins {
id("com.gradleup.salty").version(latest)
}
```

Configure the methods to forbid:

```kotlin
salty {
forbiddenMethods.add("java.util.List.removeFirst")
}
```

Salty adds a `saltyCheck${variantName}` task that visits your app bytecode using [ASM](https://asm.ow2.io/) and fails if an usage of any forbidden method is found.

`saltyCheck${variantName}` is added to the `check` task so that it is run automatically.
6 changes: 6 additions & 0 deletions Writerside/c.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE categories
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
<categories>
<category id="wrs" name="Writerside documentation" order="1"/>
</categories>
16 changes: 16 additions & 0 deletions Writerside/cfg/buildprofiles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<variables></variables>
<build-profile instance="doc">
<variables>
<noindex-content>true</noindex-content>
<download-title>GitHub</download-title>
<download-page>https://github.com/GradleUp/salty/</download-page>
<showDownloadButton>true</showDownloadButton>
<enable-browser-edits>true</enable-browser-edits>
<browser-edits-url>https://github.com/GradleUp/salty/edit/main/Writerside/</browser-edits-url>
</variables>
</build-profile>
</buildprofiles>
12 changes: 12 additions & 0 deletions Writerside/doc.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">

<instance-profile id="doc"
name="salty"
start-page="welcome.md">

<toc-element toc-title="GitHub" href="https://github.com/gradleup/salty"/>
<toc-element toc-title="Kdoc" href="https://gradleup.github.io/salty/kdoc"/>
<toc-element topic="welcome.md"/>
</instance-profile>
1 change: 1 addition & 0 deletions Writerside/topics/welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Welcome
6 changes: 6 additions & 0 deletions Writerside/v.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd">
<vars>
<var name="product" value="Writerside" />
<var name="latest_version" instance="doc" value="0.0.0" type="string" />
</vars>
8 changes: 8 additions & 0 deletions Writerside/writerside.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ihp SYSTEM "https://resources.jetbrains.com/writerside/1.0/ihp.dtd">

<ihp version="2.0">
<topics dir="topics" web-path="topics"/>
<images dir="images" web-path="images"/>
<instance src="doc.tree" />
</ihp>
15 changes: 15 additions & 0 deletions android-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
Loading

0 comments on commit 9b859de

Please sign in to comment.