Skip to content

Commit

Permalink
9.0.0 (#51)
Browse files Browse the repository at this point in the history
* [Feature] Dynamic state parent group (#48)

* feat: add parentGroup field in createState message

* bump SDK and TP Api version

* Change parameter order

* feat: use the name from the category of the categoryId if parentGroup isn't specified

* fix: typo's in stateId
fix: use correct categoryId

* fix: add check for category id from constants

* fix: break outer loop

* feat: add CategoryHelper.getCategoryShortId method

* core: Upgrade dependencies

* core: Upgrade Gradle version to 7.5.1

* core: Upgrade Gradle version to 7.5.1

* core: Upgrade Gradle version to 7.5.1

* core: Upgrade Gradle version to 7.5.1

* core: Upgrade Gradle version to 7.5.1

* core: Dependencies management

* core: ActionTranslation annotation

* fix: Github Workflow

* fix: Github Workflows

* fix: Github Workflows

* fix: Github Workflows

* fix: Tests wait time

* fix: Packager SNAPSHOT publication

* fix: Packager SNAPSHOT publication

* fix: Packager SNAPSHOT publication

* fix: Packager SNAPSHOT publication

* fix: Packager SNAPSHOT publication

* feat: Plugin ParentCategory

* feat: TouchPortalPlugin.getBase64ImageFromUrl closes #38

* fix: Set encoding to UTF-8

* feat: TP Plugin API 7 Platform start command

* core: Refactor Annotations Processor
core: TP_JAVA_FILE

* fix: JavaDoc

* fix: JavaDoc

* fix: JavaDoc

* core: Refactor Annotations Processor

* core: Add logs in tests

* core: (WIP) Modularization closes #54

* doc: Update Samples and README.md

* core: Call TPInvokable.onInvoke from callbacksExecutor

* core: TPInvokable.onListChanged
core: Use callbacksExecutor

* core: Revert to System Java instalation

* core: Revert to System Java instalation

* core: 9.0.0

* Feat: TriggerEvent (#63)

* Feat: forceUpdate (#64)

Co-authored-by: Christophe Carvalho Vilas-Boas <[email protected]>

* Change `sdk` to `api` (#66)

* Add CodeQL workflow for GitHub code scanning (#53)

Co-authored-by: LGTM Migrator <[email protected]>

* [API 7] Setting Tooltip (#65)

* Feat: Setting Tooltip

* fix: use java 8

* Remove empty lines

* Check if empty

* use UpperCamelCase instead of Full uppercase

* Check if empty

---------

Co-authored-by: Pjiesco <[email protected]>
Co-authored-by: lgtm-com[bot] <43144390+lgtm-com[bot]@users.noreply.github.com>
Co-authored-by: LGTM Migrator <[email protected]>
  • Loading branch information
4 people authored Nov 18, 2024
1 parent 97f71be commit a3ce808
Show file tree
Hide file tree
Showing 57 changed files with 2,349 additions and 1,358 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "28 7 * * 6"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ java ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
32 changes: 20 additions & 12 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8
java-package: jdk
distribution: temurin
java-version: 8
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Gradle Plugin Publish Local
run: |
./gradlew :Packager:publishToMavenLocal
env:
PGP_KEY: ${{ secrets.PGP_KEY }}
PGP_PWD: ${{ secrets.PGP_PWD }}

build:

needs: prepare-maven-local
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8
java-package: jdk
- name: Grant execute permission for gradlew
run: chmod +x gradlew
distribution: temurin
java-version: 8
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew build

Expand All @@ -45,9 +50,12 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: temurin
java-version: 8
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Gradle Maven Publish
run: |
./gradlew publishMavenJavaPublicationToMavenRepository
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8
java-package: jdk
- name: Grant execute permission for gradlew
run: chmod +x gradlew
distribution: temurin
java-version: 8
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew build
- name: JaCoco Test Report
Expand All @@ -33,11 +33,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: temurin
java-version: 8
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Gradle Maven Publish
run: |
./gradlew publishMavenJavaPublicationToMavenRepository
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8
java-package: jdk
- name: Grant execute permission for gradlew
run: chmod +x gradlew
distribution: temurin
java-version: 8
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run unit tests
run: ./gradlew Library:test
- name: Upload Failing Unit Test Results
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Unit and Int Test Failure Results
path: ./Library/build/reports/tests/**
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,30 @@
/**
* Action Annotation
* <p>
* Target is a Method
* </p>
* <p>
* <b>If your method only has @Data annotated parameters, it will be called automatically by the SDK.</b>
* <i>If it is not the case, the SDK will call the TouchPortalPluginListener.onReceive(JsonObject jsonMessage) instead.</i>
* Target is a Method or a Class extending TPAction
* </p>
* <ul>
* <li>
* If used on a Method
* <ul>
* <li>If the method only has @Data annotated parameters, it will be called automatically by the SDK.</li>
* <li>If it is not the case, the SDK will call the TouchPortalPluginListener.onReceive(JsonObject jsonMessage) instead.</li>
* </ul>
* </li>
* <li>
* If used on a Class, the SDK will
* <ul>
* <li>Create a new instance of the Class</li>
* <li>Set the instance's {@link Data} annotated fields</li>
* <li>Call the onInvoke method</li>
* </ul>
* </li>
* </ul>
*
* @see <a href="https://www.touch-portal.com/sdk/index.php?section=dynamic-actions">TP Documentation: Dynamic Actions</a>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface Action {
/**
* Action id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Touch Portal Plugin SDK
*
* Copyright 2020 Christophe Carvalho Vilas-Boas
* [email protected]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.christophecvb.touchportal.annotations;

import java.lang.annotation.*;

/**
* ActionTranslation Annotation
* <p>
* Target is a Method
* </p>
*/
@Repeatable(ActionTranslations.class)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface ActionTranslation {
/**
* ActionTranslation Language
*
* @return Language language
*/
Language language();

/**
* ActionTranslation name
* <p>
* Default is ""
* </p>
*
* @return String name
*/
String name() default "";

/**
* ActionTranslation prefix
* <p>
* Default is ""
* </p>
*
* @return String prefix
*/
String prefix() default "";

/**
* ActionTranslation description
* <p>
* Default is ""
* </p>
*
* @return String description
*/
String description() default "";

/**
* ActionTranslation format
* <p>
* Default is ""
* </p>
*
* @return String format
*/
String format() default "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.christophecvb.touchportal.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

@Target({ElementType.METHOD, ElementType.TYPE})
public @interface ActionTranslations {
ActionTranslation[] value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,30 @@
/**
* Connector Annotation
* <p>
* Target is a Method
* </p>
* <p>
* <b>If your method only has @Data annotated parameters, it will be called automatically by the SDK.</b>
* <i>If it is not the case, the SDK will call the TouchPortalPluginListener.onReceive(JsonObject jsonMessage) instead.</i>
* Target is a Method or a Class extending TPConnector
* </p>
* <ul>
* <li>
* If used on a Method
* <ul>
* <li>If the method only has @Data annotated parameters, it will be called automatically by the SDK.</li>
* <li>If it is not the case, the SDK will call the TouchPortalPluginListener.onReceive(JsonObject jsonMessage) instead.</li>
* </ul>
* </li>
* <li>
* If used on a Class, the SDK will
* <ul>
* <li>Create a new instance of the Class</li>
* <li>Set the instance's {@link Data} annotated fields</li>
* <li>Call the onInvoke method</li>
* </ul>
* </li>
* </ul>
*
* @see <a href="https://www.touch-portal.com/api/index.php?section=connectors">TP Documentation: Connectors</a>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface Connector {
/**
* Connector id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
* @see <a href="https://www.touch-portal.com/api/index.php?section=connectors">TP Documentation: Connectors</a>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@Target({ElementType.PARAMETER, ElementType.FIELD})
public @interface ConnectorValue {
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @see <a href="https://www.touch-portal.com/sdk/index.php?section=action-data">TP Documentation: Action Data</a>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@Target({ElementType.PARAMETER, ElementType.FIELD})
public @interface Data {
/**
* Data id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.christophecvb.touchportal.annotations;

/**
* Languages supported by Touch Portal
*/
public enum Language {
//ENGLISH("en"), This is the default language to provide in Action annotation
GERMAN("de"),
SPANISH("es"),
FRENCH("fr"),
DUTCH("nl"),
PORTUGUESE("pt"),
TURKISH("tr");


private final String code;

Language(String code) {
this.code = code;
}

public String getCode() {
return this.code;
}
}
Loading

0 comments on commit a3ce808

Please sign in to comment.