Skip to content

Commit

Permalink
introduce downloadable sprites (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinayagarwal authored Sep 15, 2024
1 parent 0e6b9dd commit 16dd548
Show file tree
Hide file tree
Showing 28 changed files with 2,667 additions and 262 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
server-password: MAVEN_CENTRAL_TOKEN

- name: Build Project
run: mvn -B -ntp clean verify -f emoji
run: mvn -B -ntp clean verify

- name: Publish Snapshots
if: github.ref == 'refs/heads/main'
run: |
# Find version
ver=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -f emoji)
ver=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ $ver == *"SNAPSHOT"* ]]
then
mvn -B -ntp clean deploy -f emoji
mvn -B -ntp clean deploy -pl 'emoji, offline'
fi
shell: bash
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Publish Release
id: deploy
run: |
mvn -B -ntp clean deploy -f emoji -Prelease
mvn -B -ntp clean deploy -Prelease -pl 'emoji, offline'
echo ::set-output name=exit_code::$?
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target/
# Intellij IDEA
.idea/
*.iml
emoji-updater/files
updater/files

# Mac
.DS_Store
38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Use the emoji dependency in a Maven project:

```
<dependency>
<groupId>com.gluonhq</groupId>
<groupId>com.gluonhq.emoji</groupId>
<artifactId>emoji</artifactId>
<version>${version}</version>
</dependency>
Expand All @@ -97,7 +97,27 @@ Manually build the emoji artifact:
mvn clean install -f emoji
```

### samples
### Offline
Emojis are extracted from sprites which are downloaded and stored in local file system to reduce the size of the application.
In cases where downloading of these sprites is not possible, the offline module can be added as a dependency.

```
<dependency>
<groupId>com.gluonhq.emoji</groupId>
<artifactId>offline</artifactId>
<version>${version}</version>
</dependency>
```

Manually build the offline artifact:

```
mvn clean install -f offline
```

### Samples

#### Nodes App
Simple JavaFX application that displays all emojis.
This application can be considered as a playground to test emoji and its APIs.

Expand All @@ -107,21 +127,27 @@ Each emoji is an ImageView and shows the description of the emoji on hover:

![emoji-sample-hover.png](.github/assets/emoji-sample-hover.png)

Run the sample application:
Run the sample nodes application:

```
mvn javafx:run -f samples/nodes
```

Run the sample introduction application:

```
mvn javafx:run -f samples
mvn javafx:run -f samples/introduction
```

### emoji-updater
### Updater
Utility to manually update Emoji to the latest emoji data, whenever a new version is released.
Normally, this will be used by the library developers, but in case we are falling behind, you can use it too ;)

To update the emoji list, set the [commit number](https://github.com/gluonhq/emoji/blob/main/emoji-updater/src/main/java/com/gluonhq/emoji/tools/Main.java#L39)
from [emoji-data](https://github.com/iamcal/emoji-data) and run:

```
mvn javafx:run -f emoji-updater
mvn javafx:run -f updater
```

## Contribution
Expand Down
157 changes: 7 additions & 150 deletions emoji/pom.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gluonhq</groupId>
<artifactId>emoji</artifactId>
<version>1.0.2-SNAPSHOT</version>

<name>emoji-core</name>
<name>Emoji Core</name>
<description>Emoji support for JavaFX</description>
<inceptionYear>2019</inceptionYear>
<url>https://github.com/gluonhq/emoji</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<javafx.version>20</javafx.version>
<javadoc.plugin.version>3.1.0</javadoc.plugin.version>
<gpg.plugin.version>1.6</gpg.plugin.version>
</properties>
<parent>
<groupId>com.gluonhq.emoji</groupId>
<artifactId>parent</artifactId>
<version>1.0.2-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
Expand All @@ -39,140 +32,4 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
<configuration>
<forkCount>0</forkCount>
</configuration>
</plugin>
</plugins>
</build>

<pluginRepositories>
<pluginRepository>
<id>Snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<doclint>none</doclint>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${gpg.plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- This is necessary for gpg to not try to use the pinentry programs -->
<!-- Only required for GPG >= 2.2 -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<organization>
<name>Gluon</name>
<url>https://gluonhq.com</url>
</organization>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/gluonhq/emoji/issues</url>
</issueManagement>

<licenses>
<license>
<name>GNU GENERAL PUBLIC LICENSE, Version 3</name>
<url>http://www.gnu.org/licenses/gpl-3.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<name>Abhinay Agarwal</name>
<email>abhinay.agarwal@gluonhq.com</email>
<organization>Gluon</organization>
<organizationUrl>https://www.gluonhq.com</organizationUrl>
</developer>
<developer>
<name>José Pereda</name>
<email>jose.pereda@gluonhq.com</email>
<organization>Gluon</organization>
<organizationUrl>https://www.gluonhq.com</organizationUrl>
</developer>
</developers>

<scm>
<url>https://github.com/gluonhq/emoji</url>
<connection>scm:git:git://github.com/gluonhq/emoji.git</connection>
<developerConnection>scm:git:ssh://git@github.com:gluonhq/emoji.git</developerConnection>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

</project>
</project>
Loading

0 comments on commit 16dd548

Please sign in to comment.