Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce downloadable sprites #33

Merged
merged 29 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2b44b38
introduce downloadable sprites
abhinayagarwal Aug 8, 2024
083929a
remove commented out code
abhinayagarwal Aug 8, 2024
f12aa77
add initialize and isInitialized to EmojiSpriteLoader
abhinayagarwal Aug 12, 2024
36d7fbe
use parent pom
abhinayagarwal Aug 12, 2024
196b946
update package
abhinayagarwal Aug 14, 2024
c3a3ece
update package for resources
abhinayagarwal Aug 14, 2024
1802c8d
copy files to offline and csv to core
abhinayagarwal Aug 14, 2024
3312192
fix dependency and async load
abhinayagarwal Aug 14, 2024
8c5f379
add modules for samples to parent
abhinayagarwal Aug 14, 2024
c52b2d7
check for file presence in isInitialized
abhinayagarwal Aug 18, 2024
9e2f2ab
update README.md
abhinayagarwal Aug 20, 2024
26c1b1c
update samples pom
abhinayagarwal Aug 20, 2024
1d033cc
update javafx
abhinayagarwal Aug 20, 2024
b255498
only build and release emoji and offline modules
abhinayagarwal Aug 20, 2024
e974ebd
rename file
abhinayagarwal Aug 20, 2024
ec77728
fix name
abhinayagarwal Aug 20, 2024
dd3e9e9
update demo as per feedback
abhinayagarwal Aug 20, 2024
01dcf7d
fix updater + add license
abhinayagarwal Aug 20, 2024
625f695
use Files.copy and log
abhinayagarwal Aug 20, 2024
23d5b0d
use worker thread for download
abhinayagarwal Aug 21, 2024
2a13b1a
add log if sprite file is not found
abhinayagarwal Aug 21, 2024
b8fcbb8
changes as per review comments
abhinayagarwal Sep 10, 2024
321aafe
remove unused imports
abhinayagarwal Sep 10, 2024
71ca413
make executor create daemon thread
abhinayagarwal Sep 10, 2024
8c6472b
add temporary file to monitor successful download
abhinayagarwal Sep 12, 2024
e10f6be
address review comments
abhinayagarwal Sep 12, 2024
1e53205
update package name
abhinayagarwal Sep 13, 2024
c52ea5d
update log level and naming convention
abhinayagarwal Sep 13, 2024
c2a550d
update lock file extension
abhinayagarwal Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
jperedadnr marked this conversation as resolved.
Show resolved Hide resolved
```

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
Loading