Compare commits

..

No commits in common. "c9-beta" and "c8-stream-201902" have entirely different histories.

4 changed files with 246 additions and 173 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/xmvn-4.0.0.tar.xz
SOURCES/da67577.tar.gz

View File

@ -1 +1 @@
40287aecd41b3a3f60fb633cf5b257c0a7aae232 SOURCES/xmvn-4.0.0.tar.xz
df6cdcb0a2dd366cc384c03675c1a7f568472aae SOURCES/da67577.tar.gz

View File

@ -0,0 +1,77 @@
From c9362d3f23f950bb6987c63c67b06528de3ce100 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Thu, 23 Jan 2020 12:50:42 +0100
Subject: [PATCH] Initial PoC of XMvn toolchain manager
---
.../aether/XMvnMavenLifecycleParticipant.java | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/xmvn-connector-aether/src/main/java/org/fedoraproject/xmvn/connector/aether/XMvnMavenLifecycleParticipant.java b/xmvn-connector-aether/src/main/java/org/fedoraproject/xmvn/connector/aether/XMvnMavenLifecycleParticipant.java
index 0e360488..ddd6151b 100644
--- a/xmvn-connector-aether/src/main/java/org/fedoraproject/xmvn/connector/aether/XMvnMavenLifecycleParticipant.java
+++ b/xmvn-connector-aether/src/main/java/org/fedoraproject/xmvn/connector/aether/XMvnMavenLifecycleParticipant.java
@@ -15,10 +15,15 @@
*/
package org.fedoraproject.xmvn.connector.aether;
+import java.util.Collections;
+
import org.apache.maven.AbstractMavenLifecycleParticipant;
import org.apache.maven.MavenExecutionException;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.toolchain.MisconfiguredToolchainException;
+import org.apache.maven.toolchain.ToolchainManagerPrivate;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.Logger;
@@ -42,6 +47,9 @@ public class XMvnMavenLifecycleParticipant
@Requirement( role = XMvnMojoExecutionListener.class )
private XMvnMojoExecutionListener mojoExecutionListener;
+ @Requirement
+ private ToolchainManagerPrivate toolchainManager;
+
@Override
public void afterSessionStart( MavenSession session )
throws MavenExecutionException
@@ -61,4 +69,34 @@ public class XMvnMavenLifecycleParticipant
chainedListener.addExecutionListener( reportGenerator );
request.setExecutionListener( chainedListener );
}
+
+ @Override
+ public void afterProjectsRead( MavenSession session )
+ throws MavenExecutionException
+ {
+ MavenProject currentProject = session.getCurrentProject();
+
+ try
+ {
+ for ( var toolchain : toolchainManager.getToolchainsForType( "jdk", session ) )
+ {
+ if ( toolchain.matchesRequirements( Collections.singletonMap( "xmvn", "xmvn" ) ) )
+ {
+ for ( var project : session.getAllProjects() )
+ {
+ session.setCurrentProject( project );
+ toolchainManager.storeToolchainToBuildContext( toolchain, session );
+ }
+ }
+ }
+ }
+ catch ( MisconfiguredToolchainException e )
+ {
+ throw new MavenExecutionException( "Unable to configure toolchains", e );
+ }
+ finally
+ {
+ session.setCurrentProject( currentProject );
+ }
+ }
}
--
2.21.0

View File

@ -1,30 +1,31 @@
%bcond_with bootstrap
# XMvn uses OSGi environment provided by Tycho, it shouldn't require
# any additional bundles.
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^osgi\\($
%if %{with bootstrap}
%global mbi 1
%endif
Name: xmvn
Version: 4.0.0
Release: 2%{?dist}
Version: 4.0.0~20191028.da67577
Release: 3%{?dist}
Summary: Local Extensions for Apache Maven
License: ASL 2.0
URL: https://fedora-java.github.io/xmvn/
BuildArch: noarch
Source0: https://github.com/fedora-java/xmvn/releases/download/%{version}/xmvn-%{version}.tar.xz
#Source0: https://github.com/fedora-java/xmvn/releases/download/%{version}/xmvn-%{version}.tar.xz
Source0: https://github.com/fedora-java/xmvn/archive/da67577.tar.gz
Patch0: 0001-Initial-PoC-of-XMvn-toolchain-manager.patch
BuildRequires: maven-local
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: mvn(com.beust:jcommander)
BuildRequires: mvn(org.apache.commons:commons-compress)
BuildRequires: mvn(org.apache.ivy:ivy)
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-api)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-util)
BuildRequires: mvn(org.apache.maven.shared:maven-invoker)
BuildRequires: mvn(org.apache.maven:maven-artifact)
BuildRequires: mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-model)
@ -42,12 +43,10 @@ BuildRequires: mvn(org.junit.jupiter:junit-jupiter)
BuildRequires: mvn(org.ow2.asm:asm)
BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.slf4j:slf4j-simple)
BuildRequires: mvn(org.xmlunit:xmlunit-assertj3)
# Maven home is used as template for XMvn home
BuildRequires: mvn(org.xmlunit:xmlunit-assertj)
# For /usr/bin/mvn, used to determine location of Maven home
BuildRequires: maven
# Test dependency (for testing compatibility with Java 8)
BuildRequires: java-1.8.0-openjdk-devel
%endif
Requires: %{name}-minimal = %{version}-%{release}
Requires: maven >= 3.6.1
@ -60,12 +59,16 @@ creating RPM packages containing Maven artifacts.
%package minimal
Summary: Dependency-reduced version of XMvn
Requires: maven-lib >= 3.4.0
Requires: %{name}-api = %{version}-%{release}
Requires: %{name}-connector-aether = %{version}-%{release}
Requires: %{name}-core = %{version}-%{release}
Requires: apache-commons-cli
Requires: apache-commons-lang3
Requires: atinject
Requires: google-guice
Requires: guava
Requires: maven-lib
Requires: maven-resolver
Requires: maven-wagon
Requires: plexus-cipher
@ -77,25 +80,48 @@ Requires: plexus-utils
Requires: sisu
Requires: slf4j
Requires: maven-lib >= 3.4.0
Requires: maven-jdk-binding
Suggests: maven-openjdk11
Obsoletes: xmvn-connector-aether < 4.0.0
%description minimal
This package provides minimal version of XMvn, incapable of using
remote repositories.
%package parent-pom
Summary: XMvn Parent POM
%description parent-pom
This package provides XMvn parent POM.
%package api
Summary: XMvn API
%description api
This package provides XMvn API module which contains public interface
for functionality implemented by XMvn Core.
%package core
Summary: XMvn library
Obsoletes: xmvn-parent-pom < 4.0.0
Obsoletes: xmvn-api < 4.0.0
Summary: XMvn Core
%description core
This package provides XMvn API and XMvn Core modules, which implement
the essential functionality of XMvn such as resolution of artifacts
from system repository.
This package provides XMvn Core module, which implements the essential
functionality of XMvn such as resolution of artifacts from system
repository.
%package connector-aether
Summary: XMvn Connector for Maven Resolver
%description connector-aether
This package provides XMvn Connector for Maven Resolver, which
provides integration of Maven Resolver with XMvn. It provides an
adapter which allows XMvn resolver to be used as Maven workspace
reader.
%package connector-ivy
Summary: XMvn Connector for Apache Ivy
%description connector-ivy
This package provides XMvn Connector for Apache Ivy, which provides
integration of Apache Ivy with XMvn. It provides an adapter which
allows XMvn resolver to be used as Ivy resolver.
%package mojo
Summary: XMvn MOJO
@ -106,29 +132,57 @@ of several MOJOs. Some goals of these MOJOs are intended to be
attached to default Maven lifecycle when building packages, others can
be called directly from Maven command line.
%package tools
Summary: XMvn tools
%package tools-pom
Summary: XMvn Tools POM
%description tools-pom
This package provides XMvn Tools parent POM.
%package resolve
Summary: XMvn Resolver
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
Obsoletes: xmvn-tools-pom < 4.0.0
Obsoletes: xmvn-bisect < 4.0.0
Obsoletes: xmvn-install < 4.0.0
Obsoletes: xmvn-resolve < 4.0.0
Obsoletes: xmvn-subst < 4.0.0
%description tools
This package provides various XMvn tools:
* XMvn Install, which is a command-line interface to XMvn installer.
The installer reads reactor metadata and performs artifact
installation according to specified configuration.
* XMvn Resolver, which is a very simple commald-line tool to resolve
Maven artifacts from system repositories. Basically it's just an
interface to artifact resolution mechanism implemented by XMvn Core.
The primary intended use case of XMvn Resolver is debugging local
artifact repositories.
* XMvn Subst, which is a tool that can substitute Maven artifact files
with symbolic links to corresponding files in artifact repository.
%description resolve
This package provides XMvn Resolver, which is a very simple
commald-line tool to resolve Maven artifacts from system repositories.
Basically it's just an interface to artifact resolution mechanism
implemented by XMvn Core. The primary intended use case of XMvn
Resolver is debugging local artifact repositories.
%package bisect
Summary: XMvn Bisect
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
%description bisect
This package provides XMvn Bisect, which is a debugging tool that can
diagnose build failures by using bisection method.
%package subst
Summary: XMvn Subst
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
%description subst
This package provides XMvn Subst, which is a tool that can substitute
Maven artifact files with symbolic links to corresponding files in
artifact repository.
%package install
Summary: XMvn Install
Requires: apache-commons-compress
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
%description install
This package provides XMvn Install, which is a command-line interface
to XMvn installer. The installer reads reactor metadata and performs
artifact installation according to specified configuration.
%package javadoc
Summary: API documentation for %{name}
@ -137,36 +191,54 @@ Summary: API documentation for %{name}
This package provides %{summary}.
%prep
%setup -q
%setup -q -n xmvn-da67577d9252f0b1fffed546c7c23d97a97dec4b
%patch0 -p1
%mvn_package ::tar.gz: __noinstall
%mvn_package ":{xmvn,xmvn-connector}" xmvn
%mvn_package ":xmvn-{api,core,parent}" core
%mvn_package ":xmvn-mojo" mojo
%mvn_package ":xmvn-{install,resolve,subst,tools}" tools
# Bisect IT has no chances of working in local, offline mode, without
# network access - it needs to access remote repositories.
find -name BisectIntegrationTest.java -delete
# Resolver IT won't work either - it tries to execute JAR file, which
# relies on Class-Path in manifest, which is forbidden in Fedora...
find -name ResolverIntegrationTest.java -delete
%pom_remove_plugin -r :maven-site-plugin
%mvn_package ":xmvn{,-it}" __noinstall
%pom_disable_module xmvn-connector-gradle
# Upstream code quality checks, not relevant when building RPMs
%pom_remove_plugin -r :apache-rat-plugin
%pom_remove_plugin -r :maven-checkstyle-plugin
%pom_remove_plugin -r :jacoco-maven-plugin
# FIXME pom macros don't seem to support submodules in profile
%pom_remove_plugin :jacoco-maven-plugin xmvn-it
# remove dependency plugin maven-binaries execution
# we provide apache-maven by symlink
%pom_xpath_remove "pom:executions/pom:execution[pom:id[text()='maven-binaries']]"
# Don't put Class-Path attributes in manifests
%pom_remove_plugin :maven-jar-plugin xmvn-tools
# Copy Maven home packaged as RPM instead of unpacking Maven binary
# tarball with maven-dependency-plugin
%pom_remove_plugin :maven-dependency-plugin
maven_home=$(realpath $(dirname $(realpath $(%{?jpb_env} which mvn)))/..)
# get mavenVersion that is expected
maven_home=$(realpath $(dirname $(realpath $(which mvn)))/..)
mver=$(sed -n '/<mavenVersion>/{s/.*>\(.*\)<.*/\1/;p}' \
xmvn-parent/pom.xml)
mkdir -p target/dependency/
cp -a "${maven_home}" target/dependency/apache-maven-$mver
cp -a ${maven_home} target/dependency/apache-maven-$mver
%build
%mvn_build -j -- -P\\!quality
%mvn_build -s -j
version=4.0.0
tar --delay-directory-restore -xvf target/xmvn-*-bin.tar.gz
version=4.0.0-SNAPSHOT
tar --delay-directory-restore -xvf target/*tar.bz2
chmod -R +rwX %{name}-${version}*
# These are installed as doc
rm -f %{name}-${version}*/{AUTHORS-XMVN,README-XMVN.md,LICENSE,NOTICE,NOTICE-XMVN}
# Not needed - we use JPackage launcher scripts
rm -Rf %{name}-${version}*/lib/{installer,resolver,subst}/
rm -Rf %{name}-${version}*/lib/{installer,resolver,subst,bisect}/
# Irrelevant Maven launcher scripts
rm -f %{name}-${version}*/bin/*
@ -174,32 +246,32 @@ rm -f %{name}-${version}*/bin/*
%install
%mvn_install
version=4.0.0
maven_home=$(realpath $(dirname $(realpath $(%{?jpb_env} which mvn)))/..)
version=4.0.0-SNAPSHOT
maven_home=$(realpath $(dirname $(realpath $(which mvn)))/..)
install -d -m 755 %{buildroot}%{_datadir}/%{name}
cp -r%{?mbi:L} %{name}-${version}*/* %{buildroot}%{_datadir}/%{name}/
cp -r %{name}-${version}*/* %{buildroot}%{_datadir}/%{name}/
for cmd in mvn mvnDebug; do
cat <<EOF >%{buildroot}%{_datadir}/%{name}/bin/$cmd
#!/bin/sh -e
export _FEDORA_MAVEN_HOME="%{_datadir}/%{name}"
exec %{_datadir}/maven/bin/$cmd "\${@}"
exec ${maven_home}/bin/$cmd "\${@}"
EOF
chmod 755 %{buildroot}%{_datadir}/%{name}/bin/$cmd
done
# helper scripts
%jpackage_script org.fedoraproject.xmvn.tools.bisect.BisectCli "" "-Dxmvn.home=%{_datadir}/%{name}" xmvn/xmvn-bisect:beust-jcommander:maven-invoker:plexus/utils xmvn-bisect
%jpackage_script org.fedoraproject.xmvn.tools.install.cli.InstallerCli "" "" xmvn/xmvn-install:xmvn/xmvn-api:xmvn/xmvn-core:beust-jcommander:slf4j/api:slf4j/simple:objectweb-asm/asm:commons-compress xmvn-install
%jpackage_script org.fedoraproject.xmvn.tools.resolve.ResolverCli "" "" xmvn/xmvn-resolve:xmvn/xmvn-api:xmvn/xmvn-core:beust-jcommander xmvn-resolve
%jpackage_script org.fedoraproject.xmvn.tools.subst.SubstCli "" "" xmvn/xmvn-subst:xmvn/xmvn-api:xmvn/xmvn-core:beust-jcommander xmvn-subst
# copy over maven boot and lib directories
cp -r%{?mbi:L} ${maven_home}/boot/* %{buildroot}%{_datadir}/%{name}/boot/
cp -r%{?mbi:L} ${maven_home}/lib/* %{buildroot}%{_datadir}/%{name}/lib/
# copy over maven lib directory
cp -r ${maven_home}/lib/* %{buildroot}%{_datadir}/%{name}/lib/
# possibly recreate symlinks that can be automated with xmvn-subst
%if !0%{?mbi}
%if !0%{?sclraw_phase}
%{name}-subst -s -R %{buildroot} %{buildroot}%{_datadir}/%{name}/
%endif
@ -214,30 +286,10 @@ install -d -m 755 %{buildroot}%{_datadir}/%{name}/conf/
cp -P ${maven_home}/conf/settings.xml %{buildroot}%{_datadir}/%{name}/conf/
cp -P ${maven_home}/bin/m2.conf %{buildroot}%{_datadir}/%{name}/bin/
# Make sure javapackages config is not bundled
rm -rf %{buildroot}%{_datadir}/%{name}/{configuration.xml,config.d/,conf/toolchains.xml,maven-metadata/}
# Workaround for rpm bug 447156 - rpm fails to change directory to symlink
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/
%pretrans -p <lua> minimal
path = "/usr/share/xmvn/conf/logging"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
%files
%{_bindir}/mvn-local
%files minimal -f .mfiles-xmvn
%files minimal
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/bin
@ -250,73 +302,41 @@ end
%{_datadir}/%{name}/bin/mvnDebug
%{_datadir}/%{name}/boot
%{_datadir}/%{name}/conf
%ghost %{_datadir}/%{name}/conf/logging.rpmmoved
%files core -f .mfiles-core
%license LICENSE NOTICE
%files parent-pom -f .mfiles-xmvn-parent
%doc LICENSE NOTICE
%files core -f .mfiles-xmvn-core
%files api -f .mfiles-xmvn-api
%doc LICENSE NOTICE
%doc AUTHORS README.md
%files mojo -f .mfiles-mojo
%files connector-aether -f .mfiles-xmvn-connector-aether
%files tools -f .mfiles-tools
%{_bindir}/%{name}-install
%files connector-ivy -f .mfiles-xmvn-connector-ivy
%files mojo -f .mfiles-xmvn-mojo
%files tools-pom -f .mfiles-xmvn-tools
%files resolve -f .mfiles-xmvn-resolve
%{_bindir}/%{name}-resolve
%files bisect -f .mfiles-xmvn-bisect
%{_bindir}/%{name}-bisect
%files subst -f .mfiles-xmvn-subst
%{_bindir}/%{name}-subst
%files install -f .mfiles-xmvn-install
%{_bindir}/%{name}-install
%files javadoc
%license LICENSE NOTICE
%doc LICENSE NOTICE
%changelog
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 4.0.0-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Mon Jul 26 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-1
- Update to upstream version 4.0.0
* Wed Jun 09 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-10
- Rebuild to workaround DistroBaker issue
* Tue Jun 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-9
- Bootstrap Maven for CentOS Stream 9
* Tue Jun 01 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-8
- Workaround for rpm bug 447156 - rpm fails to change directory to symlink
* Wed May 26 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-7
- Conditionally enable Ivy connector
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-6
- Bootstrap build
- Non-bootstrap build
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 3.1.0-6
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Thu Jul 09 2020 Mat Booth <mat.booth@redhat.com> - 3.1.0-5
- Honour source parameter in javadoc mojo
* Fri Jun 26 2020 Alexander Kurtakov <akurtako@redhat.com> 3.1.0-4
- Rebuild to pick jsr250-api switch to jakarta-annotations.
* Thu Jun 25 2020 Alexander Kurtakov <akurtako@redhat.com> 3.1.0-3
- Ignore test failures as they fail when built Java 11.
* Mon Apr 20 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-5
- Disable Ivy connector
* Wed Feb 19 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-4
- Require maven-jdk-binding
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jan 23 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-3
- Implement toolchain manager
@ -326,24 +346,6 @@ end
* Mon Oct 28 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-1
- Update to upstream snapshot of 4.0.0
* Thu Oct 17 2019 Fabio Valentini <decathorpe@gmail.com> - 3.1.0-1
- Update to version 3.1.0.
* Thu Oct 17 2019 Fabio Valentini <decathorpe@gmail.com> - 3.0.0-28
- Bump requirement to maven 3.6.1 and non-compat guava.
* Mon Sep 02 2019 Marian Koncek <mkoncek@redhat.com> - 3.0.0-27
- Port to maven-invoker 3.0.1
* Thu Aug 22 2019 Fabio Valentini <decathorpe@gmail.com> - 3.0.0-26
- Port to xmlunit2.
* Sun Aug 11 2019 Fabio Valentini <decathorpe@gmail.com> - 3.0.0-25
- Disable gradle support by default.
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Jun 28 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.0-2
- Prefer namespaced metadata when duplicates are found
@ -362,12 +364,6 @@ end
* Sat Apr 13 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.0.0-22
- Switch to Maven 3.6.1 and non-compat Guava
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Oct 30 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.0.0-22
- Port to Gradle 4.4.1
* Wed Aug 01 2018 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.0-21
- Add requirement on javapackages-tools since scripts use
java-functions.